InvalidArgumentException: Class "toolbar_menu_navigation_links" does not exist.

Created on 13 January 2025, 3 months ago

Problem/Motivation

When installing gin without activated core module "toolbar" you get the following error:

InvalidArgumentException: Class "toolbar_menu_navigation_links" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 32 of core/lib/Drupal/Core/DependencyInjection/ClassResolver.php). 

Steps to reproduce

Install Drupal without "toolbar" e.g. with "minimal" profile and then try to activate gin theme.

Currently the info file contains no module dependency but this comment:

# These dependencies will not allow the installation of Gin at all if gin_toolbar is not activated.
# A bit harsh, so we'll continue to just rely on the composer requirement for now.
# dependencies:
#   - drupal:gin_toolbar
#   - drupal:link

Proposed resolution

Add dependency "drupal:gin_toolbar"

Remaining tasks

Change code.

User interface changes

-

API changes

-

Data model changes

-

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇩🇪Germany c-logemann Frankfurt/M, Germany

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

Merge Requests

Comments & Activities

  • Issue created by @c-logemann
  • Merge request !567Added dependency "drupal:toolbar" → (Open) created by c-logemann
  • 🇩🇪Germany c-logemann Frankfurt/M, Germany
  • Pipeline finished with Success
    3 months ago
    Total: 226s
    #394846
  • 🇩🇪Germany c-logemann Frankfurt/M, Germany
  • 🇨🇭Switzerland saschaeggi Zurich

    We don't want to add an explicit dependency. Also toolbar will soon be replaced by the new navigation module.

    Unfortunately I'll have to close this as won't fix.

  • 🇩🇪Germany c-logemann Frankfurt/M, Germany

    I think we have different opinions about stable code.

  • 🇨🇭Switzerland saschaeggi Zurich

    I don't think we have different opinions about stable code – but there is quite some complexity maintaining the main admin theme which has a ton of hidden requirements for different use cases which might not be obvious at the first glance.

  • 🇨🇳China huangweiqiu

    I got this issue just now by installing latest gin theme without toolbar module enabled what caused me couldn't access any admin page.

    I had to use below code snippet to change the admin theme so that I can access the admin pages again.

    $config = \Drupal::service('config.factory')->getEditable('system.theme');
    $config->set('admin', 'YOUR_THEME')->save();
    

    Even if I install toolbar,I still couldn't get the gin 4.0.2 working.
    it seems that it also has conflicts with the module Ui Icons:~

    2025/01/25 01:05:51 [error] 14876#17080: *377 FastCGI sent in stderr: "Uncaught PHP Exception Error: "Call to a member function getOption() on string" at H:\wemp\nginx\html\nkmz\modules\contrib\ui_icons\modules\ui_icons_menu\ui_icons_menu.module line 95" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /admin/appearance HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:81", referrer: "http://127.0.0.1:81/admin/appearance"

Production build 0.71.5 2024