Review main Merged

89624[BUGFIX] Correct usage of IsFileSelectableEvent

Dennis Purisevic CR +2 V +2 Normal +89 −13 updated 06/28/25, 03:00

Commit message

During the rework of the FileList, the IsFileSelectableEvent was not
migrated correctly. Instead of remaining available only in the
FileBrowser, it was moved to the FileList. Additionally, its purpose and
usage were misunderstood—likely due to the challenge of naming things
clearly.

This resulted in patches that attempted to fix the original issue by
applying workarounds, without addressing the root cause. Unfortunately,
these patches also introduced new regressions, further complicating the
behavior and stability of the FileList.

The underlying concept of the FileList assumes that each resource has a
primary action, which must be implemented by the consuming view.
Displaying disabled items was never intended.

The event was introduced to provide fine-grained control over which
files a user may select. This control should reflect the FileList's
display logic. However, it was mistakenly applied to the selectable
option, which has a different meaning: a file that is not selectable
should never be shown to the user in the first place.

This patch removes the related workarounds in the FileList and
introduces a new matcher, since the current matching logic only supports
OR operations. The event has now been relocated and is exclusively used
in the FileBrowser, as originally intended.

Review

  • Code review CR +2 Done
    • Benjamin Kott +2
    • Andreas Kienast +1
  • Verified V +2 Done
    • Benjamin Kott +2
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 2

Files 4

Review log 3142

Show 1317 earlier messages
  1. Dennis Purisevic uploaded patch set 1 06/04/25, 08:29

  2. core-ci voted on patch set 1 V +1 06/04/25, 08:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79840

  3. Dennis Purisevic uploaded patch set 2 V +1 06/04/25, 15:53

  4. Dennis Purisevic wrote 06/04/25, 15:55

    Topic set to ux
  5. core-ci voted on patch set 2 V +1 06/04/25, 16:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79878

  6. Garvin Hicking commented on patch set 2 CR +1 V +1 06/05/25, 08:01

    Lovely! That is very helpful. I've attached screenshots of my review, it worked well for me.
  7. Oli Bartsch voted on patch set 2 CR +1 V +1 06/05/25, 08:24

  8. Benjamin Franzke commented on patch set 2 06/05/25, 08:42

    tree.ts:452

    `decodeURIComponent` is only "valid" for the file tree, other identifiers are not url encoded. I would prefer to avoid this kind-of "drive-by" fixes. Where exactly was `decodeURIComponent` needed/missing?
  9. Benjamin Franzke commented on patch set 2 V -1 06/05/25, 09:04

    browse-files.ts:89

    We can not trigger a generic event that invokes plain "selectNode" here, as node selection itself will trigger an update of the file selection browser. This means `/wizard/record/browse` *is requested twice* with the current approach (can be monitored via browser inspector). We should instead call `selectNode` with `propagate` set to `false` (directly and avoid adding a new event) and also explicitly expand the parents here. That means: Basically behave as `@typo3/backend/tree/tree-module-state` does, to avoid that we have to much implicit actions in `selectNode`.
  10. Benjamin Franzke uploaded patch set 3 CR +1 V +1 06/05/25, 10:03

  11. Benjamin Franzke commented on patch set 3 06/05/25, 10:03

    tree.ts:452 Reply

    Moved into where actually needed.

    browse-files.ts:89 Reply

    Done.

    FileList.php:359

    We should not try to "imply" what's selectable/browsable and what not (that depends on the view), instead the view – ElementBrowser/FileBrowser – should do this, in order to avoid changing other views (the file list backend module view), which we do not intend to change here.
  12. core-ci voted on patch set 3 V -1 06/05/25, 10:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79916

  13. Garvin Hicking uploaded patch set 4 CR +1 V +1 06/05/25, 12:09

  14. core-ci voted on patch set 4 V +1 06/05/25, 12:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79928

  15. Garvin Hicking commented on patch set 4 CR +1 V +1 06/05/25, 12:24

    Thanks for the much more lightwork overhaul of this. Works for me too, and as I understand much cleaner.
  16. Oli Bartsch voted on patch set 4 CR +1 V +1 06/05/25, 12:36

  17. Dennis Purisevic commented on patch set 4 06/05/25, 12:49

    FileBrowser.php:83

    This makes the folder selectable via a checkbox and the “Import selection” button appears.
  1. Dennis Purisevic uploaded patch set 5 CR +1 V +1 06/05/25, 13:06

  2. Dennis Purisevic commented on patch set 5 06/05/25, 13:07

    FileBrowser.php:83 Reply

    Done
  3. core-ci voted on patch set 5 V +1 06/05/25, 13:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79932

  4. Benjamin Kott commented on patch set 5 CR -1 06/05/25, 16:00

    there can be made no changes like that to the file list. this is now available for each and every implementation. it has to be limited to the usages.
  5. Dennis Purisevic commented on patch set 5 06/06/25, 07:07

    Reply

    Yes, that is correct. But maybe I'm not seeing the problem here. This change affects the following classes: - FileListController - FileBrowser - FileLinkHandler - FolderBrowser - CreateFolderBrowser - FolderLinkHandler Each implementation works as intended, with the added bonus of being able to open folders. If the intended use is to select a folder as in the FolderLinkHandler, the data attribute has already been preset and no change has been made here. Maybe you can describe the problem in more detail.
  6. Dennis Purisevic commented on patch set 5 06/06/25, 07:44

    Reply

    I have found the patch that breaks the function to click on a folder: https://review.typo3.org/c/Packages/TYPO3.CMS/+/89064
  7. Garvin Hicking updated the commit message in patch set 6 CR -1 V +1 06/06/25, 07:56

  8. core-ci voted on patch set 6 V +1 06/06/25, 08:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79972

  9. Garvin Hicking rebased onto patch set 7 V +1 06/25/25, 13:49

  10. core-ci voted on patch set 7 V +1 06/25/25, 13:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80865

  11. Benjamin Kott uploaded patch set 8 V +1 06/27/25, 08:43

  12. core-ci voted on patch set 8 V -1 06/27/25, 08:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81063

  13. Benjamin Kott uploaded patch set 9 V -1 06/27/25, 08:59

  14. Garvin Hicking commented on patch set 9 06/27/25, 09:08

    AndMatcher.php:37

    ```suggestion if ($this->matchers === []) { ```

    AndMatcher.php:52

    ```suggestion if ($this->matchers === []) { ```
  15. core-ci voted on patch set 9 V +1 06/27/25, 09:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81066

  16. Andreas Kienast commented on patch set 9 06/27/25, 09:58

    browse-files.ts:89

    I think we need this code (perhaps in a separate patch) in the Link Browser as well.
  17. Andreas Kienast uploaded patch set 10 V +1 06/27/25, 09:58

  18. core-ci voted on patch set 10 V +1 06/27/25, 10:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81068

  19. Benjamin Kott commented on patch set 10 06/27/25, 10:17

    browse-files.ts:89 Reply

    i agree, please go ahead and split it.
  20. Andreas Kienast commented on patch set 10 CR -1 06/27/25, 10:20

    on it

    browse-files.ts:89 Reply

    Alright, will extract this into a separate patch and adjust other locations as well. Giving a temp -1.
  21. Andreas Kienast uploaded patch set 11 CR -1 V +1 06/27/25, 10:33

  22. Andreas Kienast commented on patch set 11 CR +1 V +1 06/27/25, 10:38

    Reply

    Done

    AndMatcher.php:37 Reply

    Done

    AndMatcher.php:52 Reply

    Done
  23. core-ci voted on patch set 11 V +1 06/27/25, 10:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81072

  24. Benjamin Kott voted on patch set 11 CR +2 V +2 06/28/25, 02:43

  25. Benjamin Kott merged patch set 12 06/28/25, 03:00