Review main Merged

80461[BUGFIX] TS copy operator handles existing reference

Tomek Woldański 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
    • Stefan Bürk +1
    • Tomek Woldański +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Tomek Woldański +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1522

  1. Tomek Woldański uploaded patch set 1 08/08/23, 13:39

  2. core-ci voted on patch set 1 V -1 08/08/23, 13:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45241

  3. Łukasz Uznański commented on patch set 2 V -1 08/08/23, 14:11

    Published edit on patch set 1.
  4. core-ci voted on patch set 2 V +1 08/08/23, 14:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45242

  5. Christian Kuhn uploaded patch set 3 V +1 08/10/23, 10:23

  6. Christian Kuhn rebased onto patch set 4 08/10/23, 10:23

  7. Christian Kuhn updated the commit message in patch set 5 08/10/23, 10:25

  8. core-ci voted on patch set 3 V +1 08/10/23, 10:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45323

  9. core-ci voted on patch set 4 V +1 08/10/23, 10:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45324

  10. core-ci voted on patch set 5 V +1 08/10/23, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45325

  11. Christian Kuhn uploaded patch set 6 V +1 08/10/23, 10:54

  12. core-ci voted on patch set 6 V +1 08/10/23, 11:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45327

  13. Christian Kuhn commented on patch set 6 V +1 CR +1 08/10/23, 13:00

    I think that's fine but would like to wait for Tomek to re-check.
  14. Tymoteusz Motylewski commented on patch set 6 08/10/23, 13:23

    AbstractAstBuilder.php:112

    note -> node ?
  15. Christian Kuhn uploaded patch set 7 CR +1 V +1 08/10/23, 13:25

  16. Christian Kuhn commented on patch set 6 V +1 CR +1 08/10/23, 13:25

    AbstractAstBuilder.php:112 Reply

    Done. Thx.
  17. Christian Kuhn voted on patch set 7 V +1 CR +1 08/10/23, 13:26

  18. Stefan Bürk voted on patch set 7 CR +1 08/10/23, 13:32

  19. core-ci voted on patch set 7 V +1 08/10/23, 13:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45337

  20. Tomek Woldański commented on patch set 7 V +1 CR +1 08/10/23, 13:54

    Reply

    I applied refactored code onto TYPO3 12.4 instance with headless and it's working as expected!
  21. Christian Kuhn voted on patch set 7 V +2 CR +2 08/10/23, 14:11

  22. Christian Kuhn merged patch set 8 08/10/23, 14:11