Skip to content

[6.x] Fix grid min_rows breaking CP navigation - #15033

Merged
jasonvarga merged 2 commits into
6.xfrom
grid-min-rows-meta
Jul 20, 2026
Merged

[6.x] Fix grid min_rows breaking CP navigation#15033
jasonvarga merged 2 commits into
6.xfrom
grid-min-rows-meta

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where a grid field using min_rows could break Control Panel navigation until a hard refresh.

This was happening because preProcess pads empty grids to min_rows using rows with freshly generated _ids, but in two places the meta was built from a different value than the one being returned, so the padded rows had no entry in meta.existing:

  • Grid::preload built the new meta without passing along the default row values, so adding a new row containing a nested grid with min_rows produced rows without meta. (Replicator, Bard and Group already pass the defaults along.)
  • The field meta endpoint returned the preprocessed value, but built the meta while the field still held the raw value, giving lazily-loaded fields the same mismatch.

Nested fieldtypes then received undefined meta, leaving behind a broken component tree whose unmount throws the Cannot destructure property... error seen in the issue, breaking Inertia navigation until a hard refresh.

This PR fixes it by building the new meta from the default row values, and by setting the preprocessed value on the field before building the meta in the MetaController.

Fixes #14929

duncanmcclean and others added 2 commits July 20, 2026 10:12
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jasonvarga
jasonvarga merged commit f433035 into 6.x Jul 20, 2026
23 checks passed
@jasonvarga
jasonvarga deleted the grid-min-rows-meta branch July 20, 2026 13:31
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.

JS error with grid set to min_rows: 1 breaks CP navigation

2 participants