Review main Merged

87872[BUGFIX] Update FAL error handling in link browser

Fabian Schiller CR +2 V +2 Easy +8 −11 updated 01/31/25, 12:21

Commit message

Within file and folder link browsers, the latest selected
folder a user selected is stored in session data, and is
tried to be selected again on next use.

If a folder or an entire storage has been removed meanwhile,
or permissions changed and the user no longer has access,
hydration of the selected folder fails, which is not
properly sanitized.

The patch simplifies the costruct to omit guessing a
different folder that is marked as auto selected in such
cases and sanitizes the FAL API calls to avoid exceptions.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Fabian Schiller +1
    • Garvin Hicking +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Fabian Schiller +1
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2028

Show 23 earlier messages
  1. Fabian Schiller uploaded patch set 1 01/24/25, 09:29

  2. core-ci voted on patch set 1 V +1 01/24/25, 09:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72959

  3. Fabian Schiller updated the commit message in patch set 2 V +1 01/24/25, 09:56

  1. Fabian Schiller updated the commit message in patch set 3 01/24/25, 09:58

  2. Fabian Schiller updated the commit message in patch set 4 01/24/25, 09:58

  3. core-ci voted on patch set 2 V +1 01/24/25, 10:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72961

  4. core-ci voted on patch set 3 V +1 01/24/25, 10:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72962

  5. core-ci voted on patch set 4 V +1 01/24/25, 10:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72963

  6. Fabian Schiller updated the commit message in patch set 5 V +1 01/30/25, 07:03

  7. core-ci voted on patch set 5 V +1 01/30/25, 07:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73184

  8. Christian Kuhn commented on patch set 5 01/30/25, 12:50

    AbstractResourceLinkHandler.php:190

    my test setup fails here already ... investigating ...
  9. Christian Kuhn commented on patch set 5 CR -1 01/30/25, 12:54

    -1 for the time being, i think we need to have a closer look at further details. i'll see what i can do and will come back to this patch soon.
  10. Christian Kuhn commented on patch set 5 01/30/25, 18:30

    Hey Fabian. Thanks for looking at a solution and the patch! I debugged and played around with different permission setups and user state and came to the solution we should simplify the construct a bit to prevent further issues in this area. I hope its ok to push a simplified version and would love if you could have a look at it and play around with it as well?

    AbstractResourceLinkHandler.php:190 Reply

    Done

    AbstractResourceLinkHandler.php:201

    I fail to understand why the code tries to select *something* so agressively here at all: The last selected folder by a user is stored in $this->expandFolder. This is handled in above if ($this->expandFolder) (and has an issue itself). So "if (!$this->selectedFolder) {}" only kicks in, if either the last selected folder has been removed, permissions to it have been removed, or this is the very first use of the link browser. And *then* the code *still* tries to find something selected. This does not make sense. It is imho very fair to not select something different by guesswork but to let the use make a new selection. -> imho we should remove that if entirely, should sanitize the above if better, and simplify the code.
  11. Christian Kuhn uploaded patch set 6 CR -1 V +1 01/30/25, 18:38

  12. Christian Kuhn uploaded patch set 7 01/30/25, 18:39

  13. Christian Kuhn voted on patch set 7 CR +1 V +1 01/30/25, 18:41

  14. core-ci voted on patch set 6 V +1 01/30/25, 18:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73205

  15. core-ci voted on patch set 7 V +1 01/30/25, 18:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73206

  16. Garvin Hicking commented on patch set 7 CR +1 01/30/25, 19:15

    I agree with the assumption, and think "this should work". I don't see a specific scenario here that could cause trouble, but any testing/feedback on this would be appreciated. Thanks for this initiative, Fabian!
  17. Fabian Schiller commented on patch set 7 CR +1 V +1 01/31/25, 06:11

    Reply

    Hi Christian, Thank you for debugging and providing the code suggestions! I’ve tested the changes, and everything seems to be working perfectly now. The 503 error is resolved, and there are no other errors in the logs.
  18. Fabian Schiller commented on patch set 7 01/31/25, 06:11

    Hi Christian, Thank you for debugging and providing the code suggestions! I’ve tested the changes, and everything seems to be working perfectly now. The 503 error is resolved, and there are no other errors in the logs.
  19. Fabian Schiller commented on patch set 7 01/31/25, 06:18

    Reply

    Also thanks to you, Garvin, for testing and looking over it!
  20. Fabian Schiller updated the commit message in patch set 8 CR +1 V +1 01/31/25, 09:17

  21. Fabian Schiller commented on patch set 8 CR +1 V +1 01/31/25, 09:18

    Just fixed a typo in the commit message
  22. Garvin Hicking voted on patch set 8 CR +1 V +1 01/31/25, 09:20

  23. core-ci voted on patch set 8 V +1 01/31/25, 09:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73248

  24. Christian Kuhn voted on patch set 8 CR +2 V +2 01/31/25, 11:55

  25. Christian Kuhn merged patch set 9 01/31/25, 12:21