Problem/Motivation

I tried reaction to "menu item" and viewed status:
Context module: "Menu Reactions" will not work because menu.active_trail has a different menu service provider.

maybe similar problem:
https://www.drupal.org/project/context/issues/3171741

Steps to reproduce

1) add context
2) Condition: Content type: Article
3) Reactions: Menu item (Articles view)
4) warring + active menu item "Articles" doesn't work

Issue fork context-3343912

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Jaroslav Červený created an issue. See original summary.

jesmaster’s picture

I've confirmed this patch fixes the issue. FYI you need to flush the drupal cache after applying the patch.

https://www.drupal.org/project/context/issues/3171741#comment-13828996

jaroslav červený’s picture

#2 patch (https://www.drupal.org/project/context/issues/3171741#comment-13828996) is working on 5.0.0-rc1 for me.

Great. Thank you.

floown’s picture

Hello.

On a D10, the patch #6 has made the message disappear, true. But it doesn't solve the problem with taxonomy terms and a menu path as a reaction.

Regards.

admirlju made their first commit to this issue’s fork.

admirlju’s picture

@floown could you please provide a bit more information? With steps to reproduce your issue.

admirlju’s picture

Applied the #3171741: Context module: "Menu Reactions" will not work because menu.active_trail has a different menu service provider. patch and pushed it to the issue fork. So this old fix gets merged into the dev branch.

admirlju’s picture

Status: Active » Postponed (maintainer needs more info)
floown’s picture

Hi!

Here is my settings on the screencap.

Here is the result: https://www.publicitem.pro/blog/drupal
It help a little more?

Regards.

caspervoogt’s picture

Patch #6 from https://www.drupal.org/project/context/issues/3171741 fixed this for me on 5.0.0-rc1

aasarava made their first commit to this issue’s fork.

aasarava’s picture

Status: Postponed (maintainer needs more info) » Needs review

I added an updated patch that includes the ProxyClass from #3171741 comment 19 and makes an update to context.module to get rid of the "module will not work" warning message.

siramsay’s picture

Status: Needs review » Reviewed & tested by the community

I applied the patch https://www.drupal.org/project/context/issues/3171741#comment-15798491
The menu now shows on the context I set it on.
Context 5.0.0-rc1

jennydumitrescu’s picture

I've just tried adding this onto our D11 site with rc2 and it hasn't helped. I can see the patch applied but still getting the error:
Context module: "Menu Reactions" will not work because menu.active_trail has a different menu service provider.

Has anyone else managed to get this working with context/menu selection on D11?

siramsay’s picture

I had to remove this for Drupal 11. (Drupal 10.5.x is still fine)

I get this error when patched. If I remove patch, Drupal 11 recovers.

TypeError: Drupal\context\ContextMenuActiveTrail::__construct(): Argument `#5` ($context_manager) must be of type Drupal\context\ContextManager, Drupal\Core\Path\PathMatcher given, called in /Users/simonramsay/Sites/XXXXX/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\context\ContextMenuActiveTrail->__construct() (line 26 of modules/contrib/context/src/ContextMenuActiveTrail.php).
siramsay’s picture