Review main Merged

88537[BUGFIX] Fix preview with extendToSubpages

Sybille Peters CR +2 V +2 Easy +17 −18 updated 04/11/25, 11:59

Commit message

A problem in combination with extendToSubpages still existed and
resulted in page displayed with a 403 error, if logged in the
backend, if

- current page is hidden=0
- current page has extendToSubpages=1
- parent page has hidden=1
- parent page has extendToSubpages=1
- user is logged in Backend and opens pages via preview
- admin panel is not active

The problem did not exist if the current page had extendToSubpages=0,
which was introduced while fixing issue #17599.

This is now fixed: In PreviewSimulator::checkIfRootlineRequiresPreview
it was checked if the current page has extendToSubpages=1, but this
is completely irrelevant to the visibility of the current page.
So the check is removed.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benni Mack +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 4

Files 1

Review log 2026

Show 1 earlier messages
  1. Sybille Peters uploaded patch set 1 03/07/25, 17:27

  1. core-ci voted on patch set 1 V +1 03/07/25, 17:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75318

  2. Sybille Peters commented on patch set 1 03/07/25, 17:49

    The behaviour if logged in is now better (no 403), but if not logged in, it still shows 403 error. It should be 404.
  3. Sybille Peters uploaded patch set 2 V +1 03/07/25, 18:00

  4. Sybille Peters commented on patch set 1 03/07/25, 18:00

    Reply

    Done
  5. core-ci voted on patch set 2 V -1 03/07/25, 18:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75319

  6. Garvin Hicking commented on patch set 2 03/07/25, 19:09

    Didn't dig into this yet, but did you see #17599 (https://review.typo3.org/c/Packages/TYPO3.CMS/+/79656) which specifically introduced this checks for a case - does this aspect still work with the removal?
  7. Sybille Peters uploaded patch set 3 V -1 03/08/25, 09:17

  8. Sybille Peters commented on patch set 2 03/08/25, 09:20

    Reply

    I removed the change in FE with not logged in (403 => 404). Some tests failed and it looks like this is more complicated and needs better differentiation why a page is not accessible. If rootline is hidden, I think a 404 error should be evoked, not 403. But e.g. if FE user is required, we should still give 403. I will check if other issues and / or patches open. Probably best to handle this separately.
  9. core-ci voted on patch set 3 V +1 03/08/25, 09:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75349

  10. Sybille Peters commented on patch set 3 03/09/25, 08:22

    Reply

    Set this to "Unresolved". Even if we do not use this patch, I would like to clarify why the if was there, see line 105 in PreviewSimulator of previous patch: if (!(bool)($pageInfo['extendToSubpages'] ?? false)) { https://review.typo3.org/c/Packages/TYPO3.CMS/+/79656/6/typo3/sysext/frontend/Classes/Middleware/PreviewSimulator.php#93 From my understanding it makes no sense to query extendToSubpages of current patch in general and in that context. Can anyone help to understand? Can the if be removed?
  11. Benni Mack commented on patch set 3 03/25/25, 21:06

    Reply

    this is correct, we do not need to evaluate extendToSubpages on the current page. The correct solution should reside in RecordAccessVoter and we should use this everywhere.
  12. Benni Mack commented on patch set 3 03/25/25, 21:07

    I think this patch solves the same issue https://review.typo3.org/c/Packages/TYPO3.CMS/+/84998 - and fits what I wanted to say.
  13. Sybille Peters commented on patch set 3 04/06/25, 07:00

    Reply

    The other patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/84998 does not remove checking the extedToSubpages of the current page: if (!(bool)($pageInfo['extendToSubpages'] ?? false)) { Shouldn't that be removed in any case?
  14. Benni Mack commented on patch set 3 04/07/25, 13:34

    Reply

    you are right, I've found the relevant changes in this regard: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74499 I find it interesting that the same check was added in the BackendUtility::ADMCMD_previewCmds() in https://review.typo3.org/c/Packages/TYPO3.CMS/+/68731 a) we need to have both places adapted, and b) we need to have tests in place for this
  15. Benni Mack commented on patch set 4 V +1 04/10/25, 22:41

    Published edit on patch set 3.
  16. Benni Mack updated the commit message in patch set 5 04/10/25, 22:42

  17. Benni Mack voted on patch set 5 CR +1 V +1 04/10/25, 22:42

  18. Benni Mack commented on patch set 5 04/10/25, 22:42

    Reply

    Done

    Reply

    Done
  19. core-ci voted on patch set 4 V +1 04/10/25, 22:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77479

  20. core-ci voted on patch set 5 V +1 04/10/25, 22:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77480

  21. Stefan Bürk updated the commit message in patch set 6 CR +1 V +1 04/11/25, 09:14

  22. core-ci voted on patch set 6 V +1 04/11/25, 09:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77509

  23. Benni Mack voted on patch set 6 CR +1 V +1 04/11/25, 09:25

  24. Stefan Bürk voted on patch set 6 CR +2 V +2 04/11/25, 11:36

  25. Stefan Bürk merged patch set 7 04/11/25, 11:59