Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Migrate sub-area handles when a container moves to a different area#12866

Open
janscarton wants to merge 1 commit into
concretecms:9.5.xfrom
janscarton:fix/container-sub-area-handle-migration
Open

Migrate sub-area handles when a container moves to a different area#12866
janscarton wants to merge 1 commit into
concretecms:9.5.xfrom
janscarton:fix/container-sub-area-handle-migration

Conversation

@janscarton
Copy link
Copy Markdown
Contributor

Fixes #12865

Container sub-area handles include the parent area handle as a prefix. When processArrangement() moves a core_container block to a different area, it updates the container block's own arHandle but 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 a core_container and the area changed, the old handle prefix is replaced with the new one across CollectionVersionBlocks, CollectionVersionBlockStyles, CollectionVersionBlocksCacheSettings, and Areas. Stale output cache entries are deleted. Uses SQL REPLACE with a LIKE prefix 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.

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.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 16, 2026

CLA assistant check
All committers have signed the CLA.

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.

Migrate sub-area handles when a container moves to a different area

2 participants