Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
4.6.2
-
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:
- In the admin panel, navigate to the content type management section.
- Add a "Select" attribute to the "Landing Page" content type with the following options:
- Option 1
- Option 2
- Option 3
- Create a new Landing Page and select "Option 2" for the "Select" attribute.
- Create and run a migration with the following settings:
yaml
fieldSettings:
isMultiple: false
options:
0: Option 1
2: Option 3
- 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:
- Migrations Execution:
- Ensure it is possible to update the value of objects using the value that is to be removed to another value.
- Options Structure:
- Use value-label pairs instead of index-label pairs, to facilitate easy reordering of options.
- Admin Stability:
- Prevent admin panel crashes when a non-existent value is selected.
Acceptance Criteria:
- Migrations can update object values to another valid value before removing an existing option.
- Content type attribute options are defined using value-label pairs.
- The system automatically switches to a default value if a non-existent value is selected.
- No runtime errors occur when navigating the admin panel with a non-existent content type attribute value.