#109960Filelist tree search crashes for non-admin users with a sub-folder file mount (null deref in TreeController::filterDataAction)
Description
**Problem**
In the Filelist (“Medien”) module, using the folder-tree search field throws an uncaught error for non-admin backend users whose file mount is a sub-folder (e.g. `1:/user_upload/`) rather than the storage root. The AJAX call filestorage/tree/filterData returns HTTP 500:
Error: Call to a member function getCombinedIdentifier() on null in .../backend/Classes/Controller/FileStorage/TreeController.php line 132
The frontend then reports “Error loading the navigation – Unexpected response from server”, and the module falls back to the storage root `1:/`, which the user may not access (“missing folder permissions”).
Steps to reproduce- Create a non-admin BE user/group with a file mount on a sub-folder, e.g. `1:/user_upload/`.
- Log in as that user, open the Filelist module.
- Type any term into the tree search field that matches a folder.
- -> 500 / “Unexpected response from server”.
Admins are unaffected (their effective root is the storage root, so the loop terminates normally).
**Cause**
In TreeController::filterDataAction() the rootline walk-up loop dereferences $nextFolder after it can become null:
do {
$itemsInRootLine[$nextFolder->getCombinedIdentifier()] = ...; // line 132
try { $nextFolder = $nextFolder->getParentFolder(); }
catch (InsufficientFolderAccessPermissionsException) { $nextFolder = null; }
} while ($nextFolder?->getIdentifier() !== '/');
When the walk reaches the file-mount boundary, getParentFolder() throws, $nextFolder becomes null, but null?->getIdentifier() !== '/' is true, so the loop re-enters and calls getCombinedIdentifier()` on null.
**Regression**
This is a v14 regression. In v12.4 and v13.4 the loop condition was
} while ($nextFolder instanceof Folder && $nextFolder->getIdentifier() !== '/');
which correctly stops on null. It was changed to the null-safe ?-> form in v14, which altered the termination semantics. Still present in main.
**Suggested fix**
Restore the null guard:
} while ($nextFolder instanceof Folder && $nextFolder->getIdentifier() !== '/');
Affected versions: 14.x and main (12.4 / 13.4 not affected).
Reviews 2
Related issues 1
Files 1
History 36
-
Gerrit Code Review pushed patch set 1 for main to change 94280 status
NewUnder Review <span data-processor="relativetime" data-value="2026-06-02T13:16:12+00:00" > 06/02/26, 13:16 </span> -
Gerrit Code Review pushed patch set 2 for main to change 94280 <span data-processor="relativetime" data-value="2026-06-02T13:35:33+00:00" > 06/02/26, 13:35 </span>
-
Christian Kuhn changed Related to #106524 <span data-processor="relativetime" data-value="2026-06-02T18:57:20+00:00" > 06/02/26, 18:57 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 94281 <span data-processor="relativetime" data-value="2026-06-02T18:57:43+00:00" > 06/02/26, 18:57 </span>
-
Andreas Kienast commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-06-02T19:20:10+00:00" > 06/02/26, 19:20 </span> -
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-08-11T08:50:51+00:00" > 08/11/26, 08:50 </span>
Applied in changeset commit:5e3fc857b11c8f716df6ee7c4d28e574104f3711.