Review main Ready for review

97635[BUGFIX] Show parent folder after current folder deletion

Simon Schaufelberger CR 0 V 0 Normal +170 −5 updated 11/14/26, 18:21

Commit message

Deleting a parent folder of the currently selected folder in the file
tree removes the current folder as well, while the URL still points to
it. The file list then shows a "Missing folder permissions" error.

The file list controller now walks up the folder hierarchy and shows
the closest existing parent folder instead of the missing one. The
bookmark and "Copy URL" actions use the displayed folder as well.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 4
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/35/97635/4 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/35/97635/4 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 7

Issues 1

Files 3

Review log 1114

  1. Simon Schaufelberger uploaded patch set 1 11/14/26, 01:37

  2. core-ci voted on patch set 1 V +1 11/14/26, 01:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114406

  3. Oli Bartsch commented on patch set 1 CR -1 11/14/26, 10:30

    FileListController.php:133

    This should be enough to fix the bug. ``` while (!$storage->hasFolder($identifier)) { $parentIdentifier = $storage->getFolderIdentifierFromFileIdentifier($identifier); if ($parentIdentifier === $identifier) { break; } $identifier = $parentIdentifier; ```
  4. Simon Schaufelberger uploaded patch set 2 CR -1 V +1 11/14/26, 13:48

  5. Simon Schaufelberger commented on patch set 1 11/14/26, 13:49

    FileListController.php:133 Reply

    Done
  6. Simon Schaufelberger commented on patch set 2 11/14/26, 13:53

    FileListController.php:133 Reply

    It fixes the bug but this doesn't fix the wrong URL bug. What about the wrong url? When you copy the url, it still points to the now deleted nested folder
  7. core-ci voted on patch set 2 V +1 11/14/26, 13:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114455

  8. Oli Bartsch uploaded patch set 3 V +1 11/14/26, 16:31

  9. Oli Bartsch commented on patch set 3 11/14/26, 16:33

    FileListController.php:133 Reply

    The bookmark and 'Copy URL' context now use the resolved folder's identifier instead of the requested id.
  10. Simon Schaufelberger commented on patch set 3 11/14/26, 16:37

    FileListController.php:133 Reply

    ok but the URL in the browser is still wrong. should we also fix that?
  11. Oli Bartsch uploaded patch set 4 11/14/26, 17:28

  12. Oli Bartsch commented on patch set 4 11/14/26, 17:30

    FileListController.php:133 Reply

    I wouldn't fix it in this change. The address bar copies the list frame's URL. After the patch, the stale id is only cosmetic. A follow-up with its own Forge issue could redirect to the deleted folder's parent instead.
  13. core-ci voted on patch set 4 V +1 11/14/26, 17:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114477

  14. Simon Schaufelberger commented on patch set 4 11/14/26, 18:21

    FileListController.php:133 Reply

    Done