Problem/Motivation
Following #3615841: Config exclude_id array instead of string, the Scaffold panel's components setting is still stored as a single string with line breaks:
scaffold:
components: "ui_suite_bootstrap:grid_row\r\nui_suite_bootstrap:grid_row_1\r\nui_suite_bootstrap:grid_row_2"
ScaffoldPanel splits it again on every render.
IslandConfigurationFormTrait only converts exclude_id, by key name, so every new list setting needs another hardcoded key.
The component_status checkboxes keep unchecked values, so profiles store deprecated: '0' and obsolete: '0'.
Proposed resolution
- Store
scaffold.componentsas a list. It is still edited in a textarea, one id by line. IslandConfigurationFormTrait::submitConfigurationForm()turns a submitted string into a list when the island's default value for that key is an array. No key names are hardcoded, and this also coversexclude_id.- The trait drops unchecked
component_statusvalues, as it already does forexclude. - Add the post update
display_builder_post_update_scaffold_components_as_list()to convert stored profiles.
Remaining tasks
- Review
User interface changes
None.
API changes
IslandConfigurationFormTrait: in a contrib island using the trait, a submitted string for a key whose default value is an array is now stored as a list.
Data model changes
display_builder.islands.scaffold.components changes from string to a sequence of strings. A post update converts existing profiles.
Issue fork display_builder-3628644
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mogtofu33 commentedComment #4
mogtofu33 commentedComment #5
pdureau commentedTested locally. It works
Comment #6
mogtofu33 commented