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.components as 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 covers exclude_id.
  • The trait drops unchecked component_status values, as it already does for exclude.
  • 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.

Command icon 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

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Status: Active » Needs work

mogtofu33’s picture

Assigned: mogtofu33 » pdureau
Status: Needs work » Needs review
pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs review » Reviewed & tested by the community

Tested locally. It works

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mogtofu33 committed 774dfee8 on 1.0.x
    task: #3628644 Scaffold components config array instead of string
    
    By:...