- π¨π¦Canada joelpittet Vancouver
Sorry for the delay but sounds like the context module is passing things in that aren't the right thing.
https://www.drupal.org/project/context β - First commit to issue fork.
- πΊπΈUnited States kevinquillen
Very possible, this issue sounds like it could be related. π Context module: "Menu Reactions" will not work because menu.active_trail has a different menu service provider. Postponed: needs info
- π¨π¦Canada joelpittet Vancouver
@Ranjit1032002 I see you made a commit, but I don't see it, what is your plan?
- Status changed to Active
almost 2 years ago 4:57pm 23 May 2023 - π¨π¦Canada joelpittet Vancouver
Sounds like context module and menu_position are both trying to replace/extend the same service 'menu.active_trail' with different args.
@kevinquillen, you're totally right in #7.
Altering the service provider sounds like a bad idea all the way around, but seems to be what is recommended by core
\Drupal\Core\Menu\MenuActiveTrail::getActiveLink:117// Note: this is a very simple implementation. If you need more control // over the return value, such as matching a prioritized list of menu names, // you should substitute your own implementation for the 'menu.active_trail' // service in the container. // The menu links coming from the storage are already sorted by depth, // weight and ID.
We can hide the error and hobble menu_position like this:
https://git.drupalcode.org/project/context/-/commit/45261a4e454887db279f...Or be more forceful about the priority somehow maybe...
Any suggestions?
- Status changed to Needs review
almost 2 years ago 9:46pm 23 May 2023 - πΊπΈUnited States BradJones
joelpittet β credited BradJones β .
- π¨π¦Canada joelpittet Vancouver
How's this for a solution? Moved the class from altering the service to a service decorator. Help from @cmlara and @BradJones via slack.
- πΊπΈUnited States bradjones1 Digital Nomad Life
joelpittet β credited bradjones1 β .
- π¨π¦Canada joelpittet Vancouver
Whoops, forgot to include the deleted service provider.
- π¨π¦Canada joelpittet Vancouver
The
CacheCollector
theMenuActiveTrail
extends from is pretty tightly coupled so I extended from that as well (saves the implementation of the public methods in the decorated class). - π¨π¦Canada joelpittet Vancouver
Forgot need routeMatch service, this is now working locally from some testing.
-
joelpittet β
committed dd7c5e15 on 8.x-1.x
Issue #3283837 by joelpittet, kevinquillen, apaderno, bradjones1, cmlara...
-
joelpittet β
committed dd7c5e15 on 8.x-1.x
- Status changed to Fixed
almost 2 years ago 5:46pm 29 May 2023 - π¨π¦Canada joelpittet Vancouver
I've committed this to the dev branch for a new release soon.
Automatically closed - issue fixed for 2 weeks with no activity.