Review main Abandoned

91338[BUGFIX] Allow versioned `PID=0` records with ignoreRootLevelRestriction

Thorsten Müller CR 0 V -1 Easy +15 −1 updated 09/02/26, 20:31

Commit message

This change opens up required follup's, which need to be
investigated and checked how to deal with them:

* Versioned records are displayed for every page in the workspace,
  publishing/discarding needs to be checked permission wise.

* Displayes `preview` link (button) in the `workspace` module does
  not work in case of `pid=0` records because of missing site root
  and config making a frontend link impossible to create - or needs
  adoption.

* ...

---------------------------------------------------------------

TYPO3 provides the ability to allow placing records on `PID=0`
with the TCA controll option `ignoreRootLevelRestriction` for
workspace aware record types and unaware record types.

Currently this leads to following permission check error:

  The given page record is invalid. Missing uid.

This change modifes the handling code in `DataHandler` to
check if page permission needs to be checked to mitigate
the issue with the special case `PID=0` not existing as
record in the database, postulating following rules:

* `pages` records requires the page permission check.
* Non `pages` records for any non `PID=0` page requires
  the page permission check.
* Non `pages` records for `pid=0` having TCA option
  `ignoreRootLevelRestriction=true` set skips the
 permission check, otherwise the permission check is
 skipped directly assuming it as failed and emitting
 expected log entry doing nothing.
* For non `page` records on `pid=0` the permission
  check is overruled as `failed` if not allowed to
  `ignoreRootLevelRestrictions`.

Review

  • Code review CR 0
  • Verified V -1
    • core-ci -1 CI

Issues 1

Files 1

Review log 1823

  1. Thorsten Müller uploaded patch set 1 10/29/25, 15:01

  2. Christian Rath-Ulrich voted on patch set 1 CR +1 V +1 10/29/25, 15:06

  3. Stefan Bürk commented on patch set 1 10/29/25, 15:08

    DataHandler.php:6416

    ```suggestion if (($row['pid'] === 0 && !$schema->getCapability(TcaSchemaCapability::RestrictionRootLevel)?->shallIgnoreRootLevelRestriction()) || !$this->hasPagePermission(Permission::PAGE_SHOW, $pageRecord)) { ``` Should that not be a `OR` here instead of an `AND` ?
  4. Stefan Bürk voted on patch set 1 CR -1 10/29/25, 15:10

  5. Thorsten Müller uploaded patch set 2 CR +1 V +1 10/29/25, 16:02

  6. core-ci voted on patch set 1 V -1 10/29/25, 17:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87998

  7. core-ci voted on patch set 2 V -1 10/29/25, 18:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88005

  8. Stefan Bürk commented on patch set 2 CR -1 10/30/25, 11:44

    Unresolved

    Looking into this ... (Reviewing, Playing around, working, ...)
  9. Stefan Bürk uploaded patch set 3 CR -1 V -1 10/30/25, 14:10

  10. Stefan Bürk commented on patch set 3 10/30/25, 14:20

    DataHandler.php:6416 Reply

    Not that simple as I originally thought. Worked on it.
  11. core-ci voted on patch set 3 V +1 10/30/25, 14:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88153

  12. Thorsten Müller commented on patch set 3 10/30/25, 15:46

    DataHandler.php:6416 Reply Unresolved

    Neither AND nor OR is correct at this point. We need to intercept the following cases: pid=0 AND TCA->ignoreRootLevelRestriction=1. shallIgnoreRootLevelRestriction must be checked, Permissions must not be checked (otherwise a 503 error) pid=0 AND TCA->ignoreRootLevelRestriction=0, shallIgnoreRootLevelRestriction must be checked, Permissions must not be checked, new error message will be logged. pid>0, Permissions must be checked. My new iteration is pushed
  13. Stefan Bürk marked it work in progress 10/31/25, 15:58

  14. Andreas Wolf commented on patch set 3 12/09/25, 15:28

    This is also related to #107379 AFAICS.
  15. Thorsten Müller uploaded patch set 4 V +1 12/11/25, 15:30

  16. core-ci voted on patch set 4 V -1 12/11/25, 15:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92073

  17. Thorsten Müller commented on patch set 4 12/11/25, 15:50

    This change is ready for review.
    I tested the changes from Patchset 3, but i got the same error as before. My last changes from Patchset 4 are similar to my first solution, but a bit cleaner. It works as expected, bypassing the hasPagePermission check when pid=0 was given, while throwing a new error, if the records TCA does not ignore root level restriction. If there are some other valid cases that could occur at pid=0, please add them here!
  18. Christian Kuhn commented on patch set 4 CR -1 12/11/25, 15:54

    there are multiple issues in forge about this or very similar things, redirects is afaik affected, too. they should be connected and we have infos on some of the connected ones that should have an eye before taking a decision here.
  19. Christian Kuhn commented on patch set 4 12/11/25, 15:55

  20. Benni Mack updated the commit message in patch set 5 CR -1 V -1 04/22/26, 06:38

  21. core-ci voted on patch set 5 V -1 04/22/26, 08:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100745

  22. Christian Kuhn wrote 06/18/26, 23:09

    Removed reviewer Christian Kuhn.
  23. Benni Mack abandoned the change 09/02/26, 20:31

    Abandoning in favor of #107432, fixed already