Repository navigation
[BUGFIX] Pass colPos when moving copyToLanguage children - #783
Merged
Merged
Conversation
After copyToLanguage of a container, the copied container and its children are moved into place by separate move commands. These commands used "action: paste" without "update.colPos". Content restriction hooks (EXT:content_defender and the ContentElementRestriction hook of EXT:container) only use the paste target if "update.colPos" is set. Otherwise they cast the whole command value to int, which results in 1, and resolve the backend layout of page uid 1. If this page does not exist, an exception is thrown and copyToLanguage fails. The move commands now pass the colPos of the container and of each child. The target record is used to resolve page and column, and the regular container restrictions apply to the translated children. Tests: - Add a content_defender test for copyToLanguage on an installation without page uid 1 - Run localizeWithMultipleNestedElements with content_defender as well, with nested containers placed in a column that allows them - Move the nested containers in the localizeWithMultipleNestedElements fixtures from colPos 200 to 201, because colPos 200 does not allow them and the restrictions now apply
ervaude
approved these changes
Nov 4, 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.
After copyToLanguage of a container, the copied container and its children are moved into place by separate move commands. These commands used "action: paste" without "update.colPos".
Content restriction hooks (EXT:content_defender and the ContentElementRestriction hook of EXT:container) only use the paste target if "update.colPos" is set. Otherwise they cast the whole command value to int, which results in 1, and resolve the backend layout of page uid 1. If this page does not exist, an exception is thrown and copyToLanguage fails.
The move commands now pass the colPos of the container and of each child. The target record is used to resolve page and column, and the regular container restrictions apply to the translated children.
Tests: