Problem/Motivation

The module admin toolbar tools provides a link to the media library page and expects the view media_library with display page to be enabled.
When the page is not enabled, you will get the error: Route "view.media_library.page" does not exist.

Steps to reproduce

Disable the page display from the media_library view.

Proposed resolution

I suggest we first check if the route exists before adding the link.

Remaining tasks

  • Create patch
  • Review path

User interface changes

None

API changes

None

Data model changes

None

Comments

tim-diels created an issue. See original summary.

tim-diels’s picture

Patch provided

natedouglas’s picture

Status: Needs review » Reviewed & tested by the community

Worked for me and did not cause other issues. Setting to RTBC.

jmester13’s picture

Worked for me as well on 8.9.16.

Thanks for the work here!

  • adriancid committed 91c930d on 3.x authored by tim-diels
    Issue #3218211 by tim-diels, natedouglas, adriancid: Route "view....
adriancid’s picture

Status: Reviewed & tested by the community » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

adriancid’s picture

This bug is present in branch 2.x too

cwyattjibc’s picture

Im getting that error after the security upgrade of that module version

composer require drupal/admin_toolbar:3.0.2

core version 8.9.18

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "view.media_library.page" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 208 of core/lib/Drupal/Core/Routing/RouteProvider.php).

dallen33’s picture

Having the same issue as well.

alison’s picture

Patch works for me on 3.0.2, unsurprisingly - thank you for the fix!

I imagine it wasn't included in the latest release because the latest release was a security update, right? -- so, it'll just be in the next non-security release (though maybe just 3.x, not 2.x).

adriancid’s picture

This fix is in the dev branch, will be included in the next release.

kartagis’s picture

I came across this issue because it just happened to me. It also seems the fix has been applied. I got the error when I attempted to use one time login link.