#108711IsFileSelectableEvent hides files instead of disabling selection and lacks click-prevention
Description
A regression has been introduced in TYPO3 v13 following commit 000057083adb17c641939dd18ebfc97a0a98ae08.
The current implementation of IsFileSelectableEvent against the resourceDisplayMatcher incorrectly hides files from the view entirely when they are marked as non-selectable. Furthermore, even when a file is marked as non-selectable, the primary click action (selecting by filename/thumbnail) remains active, allowing users to bypass the restriction. Which replaces the fixes from https://review.typo3.org/c/Packages/TYPO3.CMS/+/89069
*Background*
In previous iterations, IsFileSelectableEvent intended to allow developers to define whether a file could be picked/selected (e.g., within a FileBrowser or a selection list).
The referenced commit moved this logic to the resourceDisplayMatcher. In TYPO3’s Core logic, if a display matcher returns false, the resource is not rendered at all. This conflates “Ability to see a file” with “Ability to select a file.”
Current Issues
Issue 1: Improper Use of resourceDisplayMatcher
Because the event is now dispatched within the resourceDisplayMatcher context:
Expected Behavior: If a file is not “selectable,” the checkbox should be disabled or hidden, but the file should remain visible in the list for context.
Actual Behavior: The file is completely removed from the DOM/view. Users cannot see files that exist simply because they aren’t selectable at that specific moment.
Issue 2: Primary Action Bypass (The “v12 Legacy Bug”)
When a file is marked as non-selectable (and if the display logic is bypassed to show the file), the checkbox disappears, but the file remains interactable:
The HTML attribute data-filelist-action=“primary” remains active on the file title or tile.
A user can still click the file name/thumbnail to select it, even though the checkbox is gone.
Result: The IsFileSelectableEvent is effectively bypassed by a simple mouse click on the label.
*Proposed Solution*
To restore the intended functionality and ensure a robust UI, the following changes are needed:
Logic Separation: Move the IsFileSelectableEvent check from the resourceDisplayMatcher back to resourceSelectableMatcher.
*Template Enforcement (Tile & List View):*
In the Tile view, if isFileSelectable is false, the disabled attribute must be applied to the wrapping element to prevent click events.
In the List view, the logic inside the FileList controller/component must ensure that the primary action is not assigned to the filename if the event listener has marked the file as non-selectable.
UI Consistency: Ensure that a non-selectable file is visually dimmed (standard CSS disabled state) rather than being removed from the UI entirely.
*Steps to Reproduce*
Implement an Event Listener for IsFileSelectableEvent.
Set $event->setIsFileSelectable(false) for a specific file.
Open the FileList or FileBrowser in TYPO3 v13.
Observe: The file disappears entirely (Issue 1).
(If forced to display) Observe: Clicking the file name still triggers the selection/primary action (Issue 2).
*Expected Behaviour*
clipboard-202601211143-swtm3.png
Reviews 3
Files 1
History 418
-
Gerrit Code Review pushed patch set 1 for main to change 92439 status
NewUnder Review <span data-processor="relativetime" data-value="2026-01-21T11:29:47+00:00" > 01/21/26, 11:29 </span> -
Josef Glatz changed subject
[BUG] Regression: IsFileSelectableEvent hides files instead of disabling selection and lacks click-preventionIsFileSelectableEvent hides files instead of disabling selection and lacks click-prevention Is Regression01 <span data-processor="relativetime" data-value="2026-01-21T11:33:42+00:00" > 01/21/26, 11:33 </span> -
Gerrit Code Review pushed patch set 2 for main to change 92439 <span data-processor="relativetime" data-value="2026-01-21T11:35:14+00:00" > 01/21/26, 11:35 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 92439 <span data-processor="relativetime" data-value="2026-01-21T11:44:09+00:00" > 01/21/26, 11:44 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 92537 <span data-processor="relativetime" data-value="2026-01-27T15:05:03+00:00" > 01/27/26, 15:05 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 92537 <span data-processor="relativetime" data-value="2026-01-27T15:08:01+00:00" > 01/27/26, 15:08 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 92439 <span data-processor="relativetime" data-value="2026-01-27T16:52:35+00:00" > 01/27/26, 16:52 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 92439 <span data-processor="relativetime" data-value="2026-01-27T22:47:33+00:00" > 01/27/26, 22:47 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 92439 <span data-processor="relativetime" data-value="2026-01-28T19:33:45+00:00" > 01/28/26, 19:33 </span>
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2026-04-21T11:23:50+00:00" > 04/21/26, 11:23 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 92439 <span data-processor="relativetime" data-value="2026-04-22T06:40:48+00:00" > 04/22/26, 06:40 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 92439 <span data-processor="relativetime" data-value="2026-05-19T10:24:52+00:00" > 05/19/26, 10:24 </span>
-
Stefan Froemken commented <span data-processor="relativetime" data-value="2026-05-19T13:55:23+00:00" > 05/19/26, 13:55 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 92439 <span data-processor="relativetime" data-value="2026-05-19T14:36:56+00:00" > 05/19/26, 14:36 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 92439 <span data-processor="relativetime" data-value="2026-05-20T05:31:19+00:00" > 05/20/26, 05:31 </span>
-
Garvin Hicking commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2026-10-02T12:28:09+00:00" > 10/02/26, 12:28 </span>Closing, see patch review in gerrit, couldn’t move this forward.
-
Gerrit Code Review pushed patch set 1 for main to change 97246 status
ClosedUnder Review <span data-processor="relativetime" data-value="2026-10-30T22:13:32+00:00" > 10/30/26, 22:13 </span> -
Gerrit Code Review pushed patch set 2 for main to change 97246 <span data-processor="relativetime" data-value="2026-10-30T22:34:20+00:00" > 10/30/26, 22:34 </span>
A simplyfied EventListener for testing: