Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-7511

Moving units to different unit types in measurements breaks existing products

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: High High
    • Customer request
    • 4.5.4
    • Commerce
    • Ibexa Commerce
    • Yes

    Description

      Steps to reproduce:

      1. Update the length measurements:
        ibexa_measurement:
            conversion:
                formulas:
                    - { source_unit: gauge, target_unit: meter, formula: 'value' }
            types:
                length:
                    nanometer: { symbol: "nm" }
                    micrometer: { symbol: "μm" }
                    centimeter: { symbol: "cm" }
                    millimeter: { symbol: "mm" }
                    gauge: { symbol: "ga." } # Newly added unit
                    inch: { symbol: '"' }
                    mil: { symbol: "mil" }
        
            system:
                default:
                    measurement:
                        types:
                            length:
                                - gauge
        
      2. Create a new Attribute Group with a single measurement attribute and choose "Length".
      3. Create a new Product with the gauge measurement and set it to 10 or any other value.
      4. Move the gauge unit to a new type:
        ibexa_measurement:
            types:
                gauge_type:
                    gauge: { symbol: "ga." }
        
            system:
                default:
                    measurement:
                        types:
                            gauge_type:
                                - gauge
        
      5. Refresh the page and view the Product created in the previous steps.

      Result:
      One is presented with the exception:

      Argument '$unit' is invalid: gauge for length does not exist. Available units: 'meter', 'centimeter', 'millimeter', 'foot', 'inch', 'yard', 'nanometer', 'micrometer', 'mil'

      Expected result:
      There should be a command that allows for a seamless transition to a new unit type as database records need to be updated after changing the type.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              bartlomiej.wajda@ibexa.co Bartłomiej Wajda
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: