Project

General

Profile

Actions

Bug #102831

closed

Typoscript deletion operator (>) deletes more than it should

Added by David CADU 10 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2024-01-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #97816: New TypoScript parserClosed2022-06-27

Actions
Actions #1

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
Actions #2

Updated by Christian Kuhn 10 months ago

Actions #3

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.

Actions #4

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

Actions #5

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?

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

Updated by Christian Kuhn 10 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF