Closed (fixed)
Project:
Context
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2018 at 19:15 UTC
Updated:
28 Sep 2020 at 21:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anzcar commentedHey, you are correct, these two modules do cause fatal error and break a site. Problem is they both alter "menu.active_trail" service by applying own class and adding different arguments.
Here is a quick fix that solves fatal error and gives Menu Trail by Path ability to manipulate Menus and warns users that Context Menu reactions are handled by Menu Trail by Path module instead of Context module. (Added two checks - one in ContextServiceProvider and one in .module.)
Comment #3
anzcar commentedComment #4
anzcar commentedCorrected a typo.
Comment #5
bzoks commentedReviewed patch in #4, tested and works as expected.
Comment #6
stephen ollmanTested patch against a Drupal GovCMS 8 distribution and works as advertised,
Thanks!
Comment #7
stephen ollmanWill this patch be rolled out soon?
A number of sites are waiting for it to become part of the stable release.
Comment #8
maticb commentedI think this is being held back by the fact that there is a hardcoded reference to another module. If this patch would go through, I think it should be on a more general level, e.g.: "If you are using a different menu service provider, this may not work", and the purpose of this patch should be to catch any such examples, not just one specific module.
How exactly to implement this, is a different question. We would need to somehow figure out if any of the installed modules overrides this, and then show this warning (dynamic - not with hardcoded values to only 1 module)
Comment #9
paulocsI agree with @maticb.
Let's see if we find a better solution.
Comment #10
paulocsHello @all,
here is a new patch.
I don't know if the best approach but what I did is that I verified if the core service were changed before. If so, it will display a warning like patch #4 telling the user that this reaction will not work.
Thanks.
Comment #11
paulocsPatch re-rolled.
Comment #13
paulocsFix code standard.
Comment #15
paulocsComment #17
paulocsFixed in dev branch.
Comment #18
aaronbaumancross-posting #3170929: ContainerNotInitializedException: \Drupal::$container is not initialized yet.
looks like this change is causing a fatal error during bootstrap