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

RuntimeError: Key Not Found in Content Type Attribute

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 4.6.2
    • Content
    • None

    Description

      As an admin, I want to ensure that content type attribute migrations handle non-existent values gracefully, so that the system remains stable and no runtime errors occur.

      Steps to Reproduce:

      1. In the admin panel, navigate to the content type management section.
      2. Add a "Select" attribute to the "Landing Page" content type with the following options:
        • Option 1
        • Option 2
        • Option 3
      3. Create a new Landing Page and select "Option 2" for the "Select" attribute.
      4. Create and run a migration with the following settings:

      yaml

      fieldSettings:
          isMultiple: false
          options:
              0: Option 1
              2: Option 3 
      1. Open the previously created Landing Page in the admin panel.

      Actual Result:

      • A runtime error occurs stating "Key x for array with keys doesn't exist".

      Expected Result:

      • The content type attribute should switch to a default value, and no exception should be thrown.

      Issues to Address:

      1. Migrations Execution:
        • Ensure it is possible to update the value of objects using the value that is to be removed to another value.
      2. Options Structure:
        • Use value-label pairs instead of index-label pairs, to facilitate easy reordering of options.
      3. Admin Stability:
        • Prevent admin panel crashes when a non-existent value is selected.

      Acceptance Criteria:

      1. Migrations can update object values to another valid value before removing an existing option.
      2. Content type attribute options are defined using value-label pairs.
      3. The system automatically switches to a default value if a non-existent value is selected.
      4. No runtime errors occur when navigating the admin panel with a non-existent content type attribute value.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              810dad6d-359c-45cc-a33c-0b1a8bf239c9@accounts.ibexa.co Aleksey Razbakov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: