Review main Abandoned

88594[BUGFIX] Prevent fetching hidden FileReferences in frontend

Garvin Hicking CR 0 V 0 Normal +47 −33 updated 03/14/25, 22:49

Commit message

The `FileRepository` lookup for sys_file_reference entries did
not evaluate the `hidden` field. This would lead to fetching
sys_file_references that should not be shown in the frontend,
for example evaluated by the `FilesProcessor`.

THis patch introduces a flag to indicate whether hidden
references should be fetched or not, which is utilized by
the FileProcessor / FileCollector API.

Tests are adapted with a scenario that covers a hidden
sys_file_reference entry, and which properly mocks the
`isFrontend` check of the FileRepository, which otherwise
would branch into the RelationHandler code. This does not
actually evaluate `hidden` either and might be part of
a follow-up. Since the RelationHandler is utilized in the
backend a lot, which needs to deal with hidden references,
this must be performed carefully.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 4

Review log 45

  1. Garvin Hicking uploaded patch set 1 03/14/25, 21:18

  2. core-ci voted on patch set 1 V +1 03/14/25, 21:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75615

  3. Garvin Hicking marked it work in progress 03/14/25, 21:29

  4. Garvin Hicking commented on patch set 1 CR -1 03/14/25, 21:29

    This is not right yet. ``` $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class)); ``` actually already sets `hidden=0` restriction.
  5. Garvin Hicking abandoned the change 03/14/25, 22:49

    Barking up the wrong tree. See issue for the actual reason.