Review main Merged

90225[TASK] Reduce nesting in PageRepository->versionOL

Nikita Hovratov CR +2 V +2 Normal +40 −38 updated 08/13/25, 15:47

Commit message

- Add early return if result of getWorkspaceVersionOfRecord is falsy
- Decouple if/else construct to fix PSR-12 violation

Review

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

Issues 1

Files 1

Review log 810

  1. Nikita Hovratov uploaded patch set 1 08/02/25, 15:45

  2. core-ci voted on patch set 1 V +1 08/02/25, 15:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82667

  3. Nikita Hovratov updated the commit message in patch set 2 V +1 08/02/25, 15:53

  4. core-ci voted on patch set 2 V +1 08/02/25, 16:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82668

  5. Oliver Klee voted on patch set 2 CR +1 V +1 08/03/25, 07:57

  6. Stefan Bürk commented on patch set 2 CR -1 08/11/25, 01:28

    PageRepository.php:1681

    The commit message states, that the aim is to refactor this to early return while I'm still not getting the real reason why and for what benefit. However, the current state of the refactoring introduces a change of behaviour now, which is not explained as intended. ```php $this->getWorkspaceVersionOfRecord(/* ... */) ``` may returns -1/-2 if record (offline/online) existed but had enableFields that would disable it. Before, $row would have been set to `false` in that case, now it stays what has been putted in for it which I would consider a change of behaviour. Taking the start of the method it is clear that $row" must be at least an array with uid and t3ver_oid. If that change in behaviour is intended it needs to be explaind and I'd say the main reasoning for the change ... and may eventually considered breaking than.
  7. Stefan Bürk commented on patch set 2 CR 0 08/11/25, 01:36

    PageRepository.php:1681 Reply

    Forget what I wrote .. -1/-2 will be taken as boolean true and than the code setting the row to false is executed. Removing -1 for that reason and resolving the comment chain.
  8. Stefan Bürk commented on patch set 2 08/11/25, 01:36

    PageRepository.php:1681 Reply

  9. Christian Kuhn voted on patch set 2 CR +2 V +2 08/13/25, 15:01

  10. Christian Kuhn merged patch set 3 08/13/25, 15:47