Migrate sub-area handles when a container moves to a different area#12866
Open
janscarton wants to merge 1 commit into
Open
Migrate sub-area handles when a container moves to a different area#12866janscarton wants to merge 1 commit into
janscarton wants to merge 1 commit into
Conversation
Container sub-area handles include the parent area handle as a prefix. When a core_container block is moved from one area to another via processArrangement, the blocks in its sub-areas keep their old handles and stop rendering — they're still in the database but the container now renders sub-areas with handles based on the new parent area. After moving the container block itself, check whether the block is a core_container and the area actually changed. If so, rewrite the arHandle prefix for all blocks in the container's sub-areas (and any nested containers) across CollectionVersionBlocks, BlockStyles, BlocksCacheSettings, and Areas. Stale output cache entries for affected handles are deleted. Uses SQL REPLACE with a LIKE prefix match, which handles arbitrarily nested containers in a single pass per table.
This was referenced Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12865
Container sub-area handles include the parent area handle as a prefix. When
processArrangement()moves acore_containerblock to a different area, it updates the container block's ownarHandlebut doesn't touch the blocks inside its sub-areas. Those blocks keep their old handles and stop rendering.This adds sub-area handle migration to
processArrangement(). After moving the block, if it's acore_containerand the area changed, the old handle prefix is replaced with the new one acrossCollectionVersionBlocks,CollectionVersionBlockStyles,CollectionVersionBlocksCacheSettings, andAreas. Stale output cache entries are deleted. UsesSQL REPLACEwith aLIKEprefix match, which handles nested containers in a single pass per table.This PR is safe to merge independently. The migration only runs when a container actually moves between areas. The current edit-mode JavaScript prevents that from happening, so the code is dormant until the companion bedrock PR (concretecms/bedrock#404) enables cross-area container drag. Landing this first means populated containers will be safe to move as soon as the JS changes ship.
See also #11442 for the broader container workflow discussion.