Skip to content
Snippets Groups Projects
Commit 195a0e34 authored by Tomasz Woldański's avatar Tomasz Woldański Committed by Christian Kuhn
Browse files

[BUGFIX] TS copy operator handles existing reference

This implements a rather unexpected detail when combining
reference "=<" and copy "<" operator from old TypoScript
parser.

Copy operator:

lib.source1 = TEXT
lib.source1.value = source1Value
lib.source2.otherValue = source2OtherValue
tt_content.target < lib.source1
tt_content.target < lib.source2

Result:

tt_content.target = TEXT
tt_content.target.otherValue = source2OtherValue

The tt_content.target existing value from lib.source1 is
kept, but children are reset - lib.source1.value is not
within tt_content.target anymore.

Now reference first, then copy:

lib.source1 = TEXT
lib.source1.value = source1Value
lib.source2.otherValue = source2OtherValue
tt_content.target =< lib.source1
tt_content.target < lib.source2

Old parser after resolving reference in FE:

tt_content.target = TEXT
tt_content.target.value = source1Value
tt_content.target.otherValue = source2OtherValue

New parser after resolving reference in FE:

tt_content.target = TEXT
tt_content.target.otherValue = source2OtherValue

The old parser keeps existing references when the copy
operator does not reset the value to something else.

The patch adapts the new parser to behave identical and
refactors the AST copy method to better documented, more
easy and eventually also quicker code.

Resolves: #100115
Releases: main, 12.4
Change-Id: Ia03cefd6e550833bdc9120a179881d04bf70d117
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80509


Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 29b3d5dd
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment