Fatal error when enabling the new experimental sidebar navigation

Created on 14 October 2023, 9 months ago
Updated 10 November 2023, 8 months ago

I wanted to test the new experimental sidebar navigation but I got an error. The website was unreachable; I had to use drush to change the admin theme.

The error was:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "help.main" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of /Users/Bram/Sites/website/web/core/lib/Drupal/Core/Routing/RouteProvider.php).

I had no Help region in my custom theme. When creating a Help region, the same error was shown.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium bramvandenbulcke

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bramvandenbulcke
  • πŸ‡³πŸ‡±Netherlands Dimiter

    I also tried enabling the new experimental menu setting after updating Gin to 8.x-3.0-rc7 and Gin_Toolbar to 1.0.0-rc4 . However, the logs show a different error :

    Error: Class "Drupal\block_content\Entity\BlockContentType" not found in Drupal\gin\GinNavigation->getNavigationCreateMenuItems() (line 88 of /var/www/html/web/themes/contrib/gin/src/GinNavigation.php).
    

    I'm not sure if this is a Gin or Gin_Toolbar problem...

  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    Moving this to the Gin issue queue as the code comes from Gin.

  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich
  • @saschaeggi opened merge request.
  • Status changed to Needs review 8 months ago
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    @bramvandenbulcke @Dimiter can you verify that the MR solves your issues? TY!

  • πŸ‡ΊπŸ‡ΈUnited States kevinfunk

    Thank you saschaeggi for working on this. I found this issue today and the MR didn't solve the issue. I've attached a patch and diff of my changes that worked.

    To test

    • Install Drupal minimal profile
    • Install Toolbar module
    • Install Gin theme
    • Set Gin as Administration theme
    • Configure Gin to use "New Drupal Navigation, Test integration"
  • πŸ‡§πŸ‡ͺBelgium bramvandenbulcke

    @saschaeggi the MR shows the same error but patch 3394085-09 is working fine. The icons in the experimental sidebar look a bit weird but the functionality is working fine with this patch.

  • πŸ‡©πŸ‡ͺGermany gnuschichten

    Patch#9 is working for me (minimal profile). And yes, I can confirm that the Icons are missing - only the fallback "icon" applies:

    .toolbar-link--has-icon {
      --icon: icon("fallback"); /* Default icon, aka --basic */
    }
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    @bramvandenbulcke

    Well then let's proceed with this patch then πŸ‘

    The icons in the experimental sidebar look a bit weird but the functionality is working fine with this patch.

    Not sure what you mean with that? Are the icons broken?

  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    @gnuschichten can you try to clear the cache - might be cache related.

  • πŸ‡©πŸ‡ͺGermany gnuschichten

    @saschaeggi I cleared both the Drupal cache and the images cached in the browser. Result: Menu Icons

  • are still missing, but now the svgs for the sidebar collapse and the chevrons in the after elements are visible.
  • πŸ‡©πŸ‡ͺGermany gnuschichten

    Finding, maybe related: There is a css class, that is tranlsated into german, last class: toolbar-link toolbar-link--has-icon toolbar-link--inhalt

    I haven't checked the stylesheet yet because I just took a look at the project for the first time today, but it's probably the selector for the different menu icons?

  • Status changed to Needs work 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States paul121 Spokane, WA

    There are additional errors that leave a 500 error/white screen when node, block_content and media entity types are not installed. I tested with this MR. Output from drush ws:

    124 19/Oct 15:14 php Error Drupal\Component\Plugin\Exception\PluginNotFoundException: The "node_type" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of /var/www/html/w

    122 19/Oct 15:14 php Error Error: Class "Drupal\block_content\Entity\BlockContentType" not found in Drupal\gin\GinNavigation->getNavigationCreateMenuItems() (line 97 of /var/www/html/web/themes/gin/src/GinNavigation

    127 19/Oct 15:15 php Error Drupal\Component\Plugin\Exception\PluginNotFoundException: The "media_type" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of /var/www/html/

    A simple check to make sure these entity types exist before loading them should solve the problem. Marking as Needs work, but this could move to a separate issue.

  • πŸ‡©πŸ‡ͺGermany gnuschichten

    @saschaeggi - I will test the icon bug with another language and create a new issue if necessary.

  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    @paul121 have you tested patch #9?

  • πŸ‡ΊπŸ‡ΈUnited States paul121 Spokane, WA

    Ah thanks @sachaeggi I missed that. This is working great except for one last little dependency on node:

    Symfony\Component\Routing\Exception\RouteNotFoundException: Route "node.add_page" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of /var/www/html/web/core

    The node.add_page route is used as the url for the very top level "+ Create" item. Maybe we can replace this with an empty string like the Taxonomy URL is using in

    GinNavigation::getNavigationCreateMenuItems()`? In my testing none of the "parent" menu items allow navigating to their URLs, clicking only expands the menu tree. --- Oh wait... I see, you can navigate to the top-level menu item when the sidebar is collapsed + hovered.
    
    Maybe each Entity Type parent/collapsible menu in the "Create" menu could navigate to their own <code>{entity_type}.add_page

    route?

  • πŸ‡§πŸ‡ͺBelgium bramvandenbulcke

    @saschaeggi see the attached screenshot for the icons in my install.

    I only added the patch 3394085-09, I didn't add your commits 30d5cc78 and ac492711. So I have no updated CSS in my project.

  • πŸ‡«πŸ‡·France NicolasGraph Strasbourg

    I had the same issue concerning the disabled help module and the patch from #9 did the trick.
    I also confirm the issue pointed in #10 about translated classes and missing icons; this probably needs a dedicated issue.

  • Status changed to Fixed 8 months ago
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    I moved forward with patch from #9.

    Thanks y'all πŸ‘

  • I also wanted to test the new experimental sidebar navigation in one of my projects and I got an error and The website was unreachable. But in my case the error was different:

    "PHP message: Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "media_type" entity type does not exist." at /home/workshop/drupal/d10/test/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php line 139"

    At first, I tried it on a Drupal 9 site and I got the above error, then I tried it on a fresh Drupal 10 installation and I got the same error and I site was not reachable.

  • Confirming patch from #9 fixed the issue for me

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

  • Production build 0.69.0 2024