Context module: "Menu Reactions" will not work because menu.active_trail has a different menu service provider.

Created on 18 September 2020, about 4 years ago
Updated 2 October 2024, about 2 months ago

Hello everyone,
I got this warning after upgrade from 8.x-4.0-beta2 to 8.x-4.0-beta4.
For example I set conditions Content type Article and set Reaction to Menu A or child under Menu A , the "active" or "menu-item--active-trail class" are not available at all.

Drupal 8.9.6, php 7.3, Mysql 5.7 and Please the the attache about my list of active contribute modules.

Ps. I need to downgrade back to version 8.x-4.0-beta2 to solve this issue.

πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡ΉπŸ‡­Thailand DeSci

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.

  • πŸ‡¬πŸ‡§United Kingdom 8bitplateau

    When adding the patch, and then running drush cr to kick it in, Drupal complains about missing proxy class

    [warning] 
    Missing proxy class 'Drupal\context\ProxyClass\ContextMenuActiveTrail' for lazy service 'menu.active_trail'.
    Use the following command to generate the proxy class:
      php core/scripts/generate-proxy-class.php 'Drupal\context\ContextMenuActiveTrail' "modules/contrib/context/src"
    
     ProxyServicesPass.php:66
    

    Running this adds the proxy class. Looking around other modules like menu active trail, it looks like this is correct.
    Running drush cr again and the error is gone. The behavior is correct and the menu is set, but the warning is still visible in the context edit form.

    Attached is another patch with the original fix, and the proxy class.

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

    Thanks, @8bitplateau. I extended your ProxyClass patch with a small update to context.module that removes the warning message on the context edit form. Since this issue is closed and there's an active MR open for Context 5.0, I made the updates over there:
    https://www.drupal.org/project/context/issues/3343912#mr45-note385365 πŸ› Context module: "Menu Reactions" will not work because menu.active_trail has a different menu service provider. Postponed: needs info

Production build 0.71.5 2024