Review main Merged

94686[BUGFIX] Fix broken module link in breadcrumb

Josua Vogel CR +2 V +2 Hard +421 −67 updated 08/10/26, 23:39

Commit message

When editing a record from a module, the breadcrumb rendered a module
node whose link led nowhere: clicking "Users" while editing a backend
user opened /typo3/record/edit without any parameters, which fails with
"Edit form could not be loaded".

RecordBreadcrumbProvider::extractRouteIdentifier() reused the route
identifier of the current request for the current module, including a
sub-route or action. The breadcrumb renders every node from that single
identifier and supplies the page id as the only parameter, so the reused
route has to be enterable with that alone.

The identifier is now only reused when the current route belongs to the
module the node is built for, and when the current request carried no
parameters beyond the ones the breadcrumb supplies. A generic action
route such as record_edit carries no module at all, and a route that
needed further parameters - the site configuration edit route with its
site identifier, or a module sub-route with a required argument such as
the active TypoScript edit route - describes a view that can not be
reconstructed for another page. Both now fall back to the module
identifier, which is always a valid entry point.

Preserving a sub-route that is parameterized by the page id alone keeps
working, which is what issue #108072 asked for.

The site configuration views built their breadcrumb from the site root
page alone, which left the detail view unreachable from the two edit
views and gave all three the same trail. They now build it explicitly:
the module, the site root page linking to the detail view, and the
current step below it, carrying the same icon as the button that leads
there from the site overview. The module is not navigated via the page
tree, so no page rootline is involved.

The functional tests around the provider built their route with
TYPO3\CMS\Core\Routing\Route, whose second constructor argument is
$defaults rather than $options. The route identifier therefore never
reached getOption() and the tests passed through the fallback branch.
They now use the backend route and the real RouteResult, and cover both
the preserved and the discarded case.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benjamin Kott +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benjamin Kott +1
    • core-ci +1 CI

Issues 2

Files 5

Review log 1418

  1. Josua Vogel uploaded patch set 1 07/06/26, 18:06

  2. core-ci voted on patch set 1 V +1 07/06/26, 18:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104421

  3. Benjamin Franzke voted on patch set 1 CR +1 V +1 07/08/26, 10:04

  4. Benjamin Franzke commented on patch set 1 07/08/26, 12:39

    RecordBreadcrumbProvider.php:263

    Although I voted, I have the feel ing we should rewrite to use early returns. This condition becomes hardly readable.
  5. Benjamin Franzke commented on patch set 1 CR 0 V 0 07/08/26, 13:06

    Hm, this fixes the bug only implicitly, because it assumes that the route can not be "kept", when the module changes, but we have no understanding, why/when we need to use another route-identifier in general. That also applies to modules Other modules, where sub-modules are used are therefore still broken. I guess that means we need another fix. Example: Editing a site via `/module/site/configuration/edit?site=…` and clicking "Setup" in the breadcrumb leads to the route `/module/site/configuration/edit` instead of `/module/site/configuration`, which means there is still an error rendered.
  6. Benjamin Franzke commented on patch set 1 07/08/26, 13:27

    RecordBreadcrumbProvider.php:63

    We'd ideally revert to ``` $targetModule = $currentModule?->getIdentifier() ?? $this->getTargetModule(); ``` as changed in https://review.typo3.org/c/Packages/TYPO3.CMS/+/91586/4/typo3/sysext/backend/Classes/Breadcrumb/RecordBreadcrumbProvider.php#b64 here, but that would break breadcrumbs like `/module/manage/search-index/Administration/externalDocuments?id=` which then loose the `externalDocuments` submodule information. ```
  7. Josua Vogel uploaded patch set 2 V +1 07/24/26, 09:28

  8. core-ci voted on patch set 2 V +1 07/24/26, 09:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105306

  9. Josua Vogel commented on patch set 2 07/24/26, 09:57

    Reply

    Done

    RecordBreadcrumbProvider.php:63 Reply

    Done
  10. Josua Vogel uploaded patch set 3 V +1 07/24/26, 10:04

  11. Josua Vogel commented on patch set 3 07/24/26, 10:04

    RecordBreadcrumbProvider.php:263 Reply

    Done
  12. core-ci voted on patch set 3 V +1 07/24/26, 10:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105307

  13. Simon Schaufelberger voted on patch set 3 CR +1 V +1 07/28/26, 21:17

  14. Benjamin Kott uploaded patch set 4 CR +1 V +1 08/10/26, 22:08

  15. Benjamin Kott voted on patch set 4 CR +1 V +1 08/10/26, 22:08

  16. core-ci voted on patch set 4 V +1 08/10/26, 22:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106332

  17. Stefan Bürk voted on patch set 4 CR +2 V +2 08/10/26, 23:30

  18. Stefan Bürk merged patch set 5 08/10/26, 23:39