Review main Merged

72163[BUGFIX] Resolve page id correctly in ConditionMatcher

Nicole Hummel CR +2 V +2 Normal +69 −2 updated 11/15/21, 19:27

Commit message

The ConditionMatcher tries to resolve the
current page id from global variables. One of this possibilities uses the cmdMap that is sent
to the DataHandler. This patch ensures that
the correct target uid is used to resolve the
page id.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Kevin Appelt +1
  • Verified V +2 Done
    • Benni Mack +2
    • Kevin Appelt +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1619

  1. Nicole Hummel uploaded patch set 1 11/12/21, 15:37

  2. core-ci voted on patch set 1 V +1 11/12/21, 15:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19211

  3. Kevin Appelt commented on patch set 1 V +1 CR +1 11/12/21, 16:04

    After applying the patch, content elements can be moved again with NullBackend used.
  4. Oliver Klee commented on patch set 1 11/12/21, 17:05

    Can we cover this bug with a regression test?
  5. Jan Helke commented on patch set 1 V +1 CR +1 11/14/21, 09:23

    I would be happy to have this in the next release even without the regression test.
  6. Oliver Hader commented on patch set 1 11/15/21, 09:33

    ConditionMatcher.php:113

    Fixing the type issue seems to be fine...

    ConditionMatcher.php:120

    Where is the sub-key `'target'` coming from? From reading it means, `$target` can be either * `$target = 123` or * `$target['target'] = 123`
  7. Oliver Hader commented on patch set 1 11/15/21, 10:08

  8. Benni Mack uploaded patch set 2 11/15/21, 10:14

  9. Benni Mack voted on patch set 2 V +1 CR +1 11/15/21, 10:14

  10. core-ci voted on patch set 2 V +1 11/15/21, 10:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19282

  11. Oliver Hader commented on patch set 2 11/15/21, 10:33

    ConditionMatcher.php:119

    In DataHandler it is used as `$value['action'] === 'paste'`, so I guess it should be `($actionAndTarget['action'] ?? '') === 'paste'` instead?
  12. Nicole Hummel commented on patch set 2 11/15/21, 10:40

    ConditionMatcher.php:119 Reply

    AFAIK the action for "paste" is always called "move" in cmdMap, this means this change is useless.

    ConditionMatcher.php:120 Reply

    I don't know where it comes from, but in the tests I was able to trigger the needed target id is defined in $target['target']. I'm not sure if there are any other scenarios where $target is set as id so I decided to fallback to the old usecase.
  13. Benni Mack uploaded patch set 3 11/15/21, 11:05

  14. core-ci voted on patch set 3 V +1 11/15/21, 11:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19284

  15. Benni Mack voted on patch set 3 V +1 CR +1 11/15/21, 17:35

  16. Kevin Appelt voted on patch set 3 V +1 CR +1 11/15/21, 19:12

  17. Benni Mack voted on patch set 3 V +2 CR +2 11/15/21, 19:27

  18. Benni Mack merged patch set 4 11/15/21, 19:27

  19. Benni Mack commented on patch set 4 11/15/21, 19:27

    ConditionMatcher.php:113 Reply

    Done

    ConditionMatcher.php:119 Reply

    Done

    ConditionMatcher.php:120 Reply

    Done