Review 12.4 Merged

80509[BUGFIX] TS copy operator handles existing reference

Christian Kuhn CR +2 V +2 Normal +148 −40 updated 08/10/23, 14:11

Commit message

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.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 1

Files 4

Review log 34

  1. Christian Kuhn uploaded patch set 1 08/10/23, 13:56

  2. core-ci voted on patch set 1 V +1 08/10/23, 14:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45341

  3. Christian Kuhn voted on patch set 1 V +2 CR +2 08/10/23, 14:11

  4. Christian Kuhn merged patch set 2 08/10/23, 14:11