Bug #102831
closedTyposcript deletion operator (>) deletes more than it should
100%
Description
When deleting a TS node, if a node with the same index as the parent of the deleted node exists at the same level as the deleted node, it is also deleted.
This will become clearer with an example:
page = PAGE page { 10 = COA 10 { 10 = TEXT 10.value = A 20 = TEXT 20.value = B 30 = TEXT 30.value = C } 20 = COA 20 { 10 = TEXT 10.value = 1 20 = TEXT 20.value = 2 30 = TEXT 30.value = 3 } } page.10.30 > page.20.30 >
-- Result: (in FE and in the BE Active Typoscrit module) --
page.10.30 and page.20.30 will be deleted but also page.10.10 and page.20.20
page = PAGE page { 10 = COA 10 { 20 = TEXT 20.value = B } 20 = COA 20 { 10 = TEXT 10.value = 1 } }
I must have missed something, but I've done a few tests and I can't figure out what $node->removeChildByName($previousIdentifierToken->getValue()); is for
in the function \TYPO3\CMS\Core\TypoScript\AST\AbstractAstBuilder::handleIdentifierUnsetLine
Updated by Chris Müller 10 months ago
- Subject changed from Typoscrit deletion operator (>) deletes more than it should to Typoscript deletion operator (>) deletes more than it should
Updated by Christian Kuhn 10 months ago
- Related to Feature #97816: New TypoScript parser added
Updated by Christian Kuhn 10 months ago · Edited
confirmed. will fix.
thanks for looking at the code already. seems you're correct with your assessment.
Updated by Gerrit Code Review 10 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82520
Updated by Christian Kuhn 10 months ago
Thanks for the example TS, I created a unit test from this, in addition to the existing unset operator tests. Do you think the patch is fine?
Updated by Gerrit Code Review 10 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82520
Updated by Gerrit Code Review 10 months ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82520
Updated by Gerrit Code Review 10 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82559
Updated by Christian Kuhn 10 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2ec6947609ec2263801b117dc2defd35f81b3f09.