Skip to content

[IndexBundle] Match submitted index columns to the stored ones by name - #3299

Open
codingioanniskrikos wants to merge 1 commit into
5.1from
issue/3295
Open

codingioanniskrikos wants to merge 1 commit into
5.1from
issue/3295

Conversation

@codingioanniskrikos

@codingioanniskrikos codingioanniskrikos commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Since the Studio index editor sends the columns as a plain list, the form
matched them to the stored columns by position. The stored columns are
ordered by name, so after removing a column every column behind it was
mapped onto the stored column of its predecessor. A column without
interpreter that landed on an "expression" column kept that column's
interpreter form and the save failed with "expression: This value should
not be blank." (likewise "brickField" / "key" / "className" for getter
and brick configurations). Where the leftover form had no required field,
the column silently inherited the other column's configuration.

A column is identified by its name: IndexColumnCollectionType now re-keys
the submitted columns to the entry of the stored column with the same
name before the collection is resized. New and renamed columns get an
entry of their own.

IndexColumnType additionally drops the getter, interpreter and column
configuration form when the submitted column has none, and clears the
stored value, so removing the interpreter of an existing column works too.

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets #3295

What changed?

  • IndexColumnCollectionType: before the collection is resized, the submitted columns are re-keyed to the entry of the stored column with the same name (case-insensitive). New and renamed columns get an entry
    of their own.
  • IndexColumnType / AbstractConfigurableIndexColumnElementType: when the submitted column has no getter, no interpreter or no column configuration, the corresponding sub-form is removed and the stored value
    is cleared.
  • Behat: new scenario "Removing a column keeps the columns behind it"; the column table of the save step accepts an optional interpreterConfig.

Why?

Follow-up to #3296. Since the Studio index editor sends the columns as a plain list, the form matched them to the stored columns by position. The stored columns are ordered by name, so after removing a column
every column behind it was mapped onto the stored column of its predecessor:

  • A column without interpreter that landed on an expression column kept that column's interpreter form, and the save failed with expression: This value should not be blank. (likewise brickField / key /
    className for getter and brick configurations).
  • Where the leftover form had no required field, the save succeeded and the column silently inherited the other column's configuration.

The same error appeared when the interpreter of an existing expression column was removed.

A column is identified by its name (see #3296), so the form now matches by name as well. Renaming a column is therefore handled as remove + add.

Closes #3295

  Since the Studio index editor sends the columns as a plain list, the form
  matched them to the stored columns by position. The stored columns are
  ordered by name, so after removing a column every column behind it was
  mapped onto the stored column of its predecessor. A column without
  interpreter that landed on an "expression" column kept that column's
  interpreter form and the save failed with "expression: This value should
  not be blank." (likewise "brickField" / "key" / "className" for getter
  and brick configurations). Where the leftover form had no required field,
  the column silently inherited the other column's configuration.

  A column is identified by its name: IndexColumnCollectionType now re-keys
  the submitted columns to the entry of the stored column with the same
  name before the collection is resized. New and renamed columns get an
  entry of their own.

  IndexColumnType additionally drops the getter, interpreter and column
  configuration form when the submitted column has none, and clears the
  stored value, so removing the interpreter of an existing column works too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant