Skip to content

Fix Grid column reassignment when retrying a clone - #5391

Open
TomJaeger wants to merge 1 commit into
7.devfrom
fix/file-grid-clone-columns
Open

TomJaeger wants to merge 1 commit into
7.devfrom
fix/file-grid-clone-columns

Conversation

@TomJaeger

Copy link
Copy Markdown
Contributor

Summary

  • treat Grid columns as new whenever the destination Grid table is being created
  • preserve the original field's column ownership when a failed clone is saved again
  • retain normal behavior for ordinary clones and existing-field edits
  • add regression coverage for clone retries and newly added columns

Root cause

When a Grid or File Grid clone encounters a validation error, the subsequent ordinary save can retain the original column IDs without the cloning flag. Those definitions can then be reassigned to the new field, leaving the original content inaccessible and the clone referencing missing database columns.

This prevents the failure on future clones; it does not repair fields that are already damaged.

Fixes #5382

Validation

  • regression failed before the fix and passed afterward
  • coverage includes clone retries, normal clones, existing-field edits, and an additional new column
  • PHP 7.4 and 8.5: 104 tests, 290 assertions per version, with no failures, errors, or skips
  • syntax and git diff --check passed
  • independent review found no actionable issues

The reporter's exact workflow has not been reproduced through a browser with MySQL.

@TomJaeger TomJaeger added this to the 7.5.27 milestone Sep 8, 2026
@TomJaeger
TomJaeger marked this pull request as ready for review September 8, 2026 14: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.

Cloning a File Grid removes the columns from the original field and causes data loss

1 participant