Review main Merged

88964[BUGFIX] Respect visibility in GreedyDatabaseBackend

Georg Ringer CR +2 V +2 Easy +27 −0 updated 04/12/25, 15:16

Commit message

The backend must render hidden records.

Review

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

Issues 2

Files 1

Review log 1619

  1. Georg Ringer uploaded patch set 1 04/07/25, 14:43

  2. Georg Ringer commented on patch set 1 04/07/25, 14:44

    This change is ready for review.
  3. core-ci voted on patch set 1 V +1 04/07/25, 14:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77151

  4. Stefan Bürk updated the commit message in patch set 2 V +1 04/07/25, 20:40

  5. core-ci voted on patch set 2 V +1 04/07/25, 20:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77166

  6. Stefan Bürk commented on patch set 2 04/07/25, 20:46

    First, I think this is not complete. See other comment. And I guess we should add tests to cover this class and cases. Not fully into it, but it seems to be a central and essential part which should not be left without tests.

    GreedyDatabaseBackend.php:89

    Do we need to respect page id's from hidden records ? Than the visibilityAspect thing from above needs to be also abblied to this QueryBuilder instance. Sub-query are directly transformed to sql in L104 for the `IN()` part which directly applies reststrictins for this instance, and not later when executing the outer. Restrictin handling is based on the properties (from/joins) and not sub-select strings).
  7. Georg Ringer commented on patch set 2 04/07/25, 21:15

    Yes see the patch more as a wip. Currently also don't understand why in backend I need that check anyway and why hidden records are not shown by default
  8. Stefan Bürk commented on patch set 2 04/07/25, 22:54

    Reply

    QueryBuilder gets creates with DefaultRestrictionContainer, which contains for example the HiddenRestriction like the other default restriction. The restriction themself only reads TCA, and does not work context aware or based on on the context class and never has. Other places in the backend creates the QueryBuilder and removes the restriction completly setting only specific ones again, or remove special types or do it based on the context. The place here does nothing and gets full default restriction applied. Counts also for "start/end" evaluation and deleted. Not sure, but wasn't there a dedidicated "Backend Default Restriction" thingy in older versions ? There is a "frontend specific" one which add additional restrictions (default). For example PageRepository sets the full FrontendDefaultRestrictions when creating QueryBuilder instances, passing the context class to it. ``` $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($table); $queryBuilder->setRestrictions( GeneralUtility::makeInstance( FrontendRestrictionContainer::class, $this->context ) ); ```
  9. Stefan Bürk commented on patch set 2 04/07/25, 22:59

    Reply

    ``` * The records are fetched depending on * - fe_group permissions * - language (incl. overlays etc) * - workspace * - visibility restrictions (starttime / endtime / hidden / deleted) ``` I'd say that this is not respected here at all ... the GreedyDatabaseBackend is used in several places, maybe backend maybe frontend (as far as I can tell on a quick look). Special this has been added for content-blocks. But I'm not fully into it, but context seems to be quite broad and this should/needs to be checked for all places and call chains (FE/BE context) and how to set it here, and if the additional frontend restriction container needs to be used etc. Maybe @nikita.h@live.de or @benni@typo3.org needs to be asked for more insight. I added the related change as related which introduced this class - and has further related changes with ongoing usages.
  10. Benni Mack commented on patch set 2 CR -2 04/08/25, 08:36

    let me check this
  11. Benni Mack marked it work in progress 04/08/25, 09:38

  12. Benni Mack uploaded patch set 3 V +1 04/11/25, 22:05

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  13. Benni Mack marked it ready for review 04/11/25, 22:05

  14. Benni Mack voted on patch set 3 CR +1 04/11/25, 22:05

  15. Benni Mack commented on patch set 3 04/11/25, 22:06

    Reply

    Done

    GreedyDatabaseBackend.php:89 Reply

    we don't I think we're good as is.
  16. core-ci voted on patch set 3 V +1 04/11/25, 22:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77590

  17. Georg Ringer voted on patch set 3 CR +1 V +1 04/12/25, 09:51

  18. Stefan Bürk commented on patch set 3 CR +2 V +2 04/12/25, 15:04

    GreedyDatabaseBackend.php:89 Reply

    Done
  19. Stefan Bürk merged patch set 4 04/12/25, 15:16