Fatal error after installing the module (incompatibility with Context & Menu position module)

Created on 8 October 2017, over 6 years ago
Updated 1 August 2023, 11 months ago

After installing the module, I get this error:

TypeError: Argument 5 passed to Drupal\menu_trail_by_path\MenuTrailByPathActiveTrail::__construct() must implement interface Drupal\menu_trail_by_path\Path\PathHelperInterface, instance of Drupal\Core\Entity\Query\QueryFactory given, called in /var/www/drupal/public_html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 304 in Drupal\menu_trail_by_path\MenuTrailByPathActiveTrail->__construct() (line 51 of modules/contrib/menu_trail_by_path/src/MenuTrailByPathActiveTrail.php).

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland Lukas von Blarer

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia klonos 90% Melbourne, Australia - 10% Larissa, Greece

    @Berdir trying to move this forward, can you please provide some additional technical direction? What should the requirements check be, and what would you then expect the error to say?

  • πŸ‡ΊπŸ‡ΈUnited States JonMcL Brooklyn, NY

    I think @Berdir is correctly pointing out that there is unlikely a good/proper way to have this module enabled along with either the context or menu_position modules. All 3 modules are attempting to take over the menu.active_trail.

    The decorator approach does allow both context and this module to be enabled successfully, and this module's functionality does seem to work correctly in my limited tests. However, it appears that the context's ContextMenuActiveTrail class will no longer get called unless "Drupal Core Behavior" is chosen. This is probably to be expected.

    However, I think I might accept this for our use cases. If this module works well enough for us, we might not need to use the context module's "Menu" reaction. Maybe a warning on the status page (requirements) that this module is disabling the active trail functionality within the context module?

    Configuring a menu's Menu Trail Source to use Drupal Core Behavior will also again allow the context module to set the active menu trail (since it takes over core).

Production build 0.69.0 2024