Skip to content

Conversation

@i-just
Copy link
Contributor

@i-just i-just commented Dec 22, 2025

Description

The utils/fix-field-layout-uids command fixes duplicate or missing UUIDs that are found inside of given field layout.

This PR builds on top of that to ensure that all field layouts themselves also have unique UUIDs.

Background:
As issue was reported via support, where an upgrade from v4 to v5 caused some content to go missing.
Digging into it, I found that when entrifying matrix blocks, three blocks were converted to an entry type with wrong fields - fields that belonged to a different block in a different matrix field. When two field layouts have the same UID, a wrong one can be grabbed here: https://github.com/craftcms/cms/blob/5.8.21/src/migrations/m230617_070415_entrify_matrix_blocks.php#L107, leading to the described problem.

Related issues

n/a; reported by @olivierbon

@i-just i-just requested a review from brandonkelly December 22, 2025 11:15
[ci skip]
@brandonkelly brandonkelly merged commit 0b8e225 into 4.x Dec 23, 2025
2 checks passed
@brandonkelly brandonkelly deleted the bugfix/fix-field-layout-uids-util-and-duplicate-layout-uids branch December 23, 2025 00:27
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.

3 participants