govCMS / GovCMS8

Current stable release of the main GovCMS8 distribution.
GNU General Public License v2.0
60 stars 58 forks source link

Menu Trail by Path - ERROR #438

Open OPCIT opened 4 years ago

OPCIT commented 4 years ago

On local Dev enable this module and got the following error which has killed the site. Will need to use drush to disable the module. Enabling a module in the disto should never kill a site.

The website encountered an unexpected error. Please try again later. 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\context\ContextManager given, called in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 301 in Drupal\menu_trail_by_path\MenuTrailByPathActiveTrail->construct() (line 51 of modules/contrib/menu_trail_by_path/src/MenuTrailByPathActiveTrail.php).

OPCIT commented 4 years ago

ahoy drush pm-uninstall menu_trail_by_path

simesy commented 4 years ago

Can you check if you have context module installed, as I think this is a known conflict.

OPCIT commented 4 years ago

Hey Si, we certainly do have it enabled.

Whilst I found a work around to fix the lack of 'active-trail' of book navigation, it will obviously be good to get this resolved at some point by the module maintainers.

Thanks!

simesy commented 4 years ago

Ok yeah, upstream incompatibility. Ideally the distro would warn or prevent installing both.

This upstream ticket for the record. In theory if you have menu_trail_by_path installed then you don't want the Context functionality related to menu_trails, so context module gets out of the way. https://www.drupal.org/project/context/issues/3018331

simesy commented 4 years ago

I usually do my own breadcrumbs in the theme layer. The saas tools are generally lacking.

OPCIT commented 4 years ago

I wanted this module to see if it would help with book navigation output. The default template does not add any <ul> or <li> classes to help identify the active trail.

Was able to add 'book-tree.html.twig' to the theme and customise accordingly:

{% macro book_links(items, attributes, menu_level) %} {% import _self as book_tree %} {% if items %} {% if menu_level == 0 %} <ul{{ attributes }} class="book-list"> {% else %}

{% endif %} {% endmacro %}

Belhendo commented 4 years ago

Hi @OPCIT and @simesy

Thanks for the heads up, we'll investigate the conflict in the distribution and will let you know if there's a patch.

OPCIT commented 4 years ago

@Belhendo @simesy

A patch for this was released some time ago.

https://www.drupal.org/project/context/issues/3018331

I've updated a local GovCMS 8 code base and found it to work as advertised.

I can now install both modules without error.

Belhendo commented 4 years ago

Thanks for this info. We will need to wait until the patch is rolled into the next stable version of the Menu Trail by Patch module so we keep stable releases in the distribution without patches.

TobyWild commented 4 years ago

@Belhendo - The patch was created six months ago, and the last release of Context (that this patch is for) was released 3 years ago... so maybe "wait for release" isn't the best idea when the simple act of enabling a module can white screen and entire site.

OPCIT commented 4 years ago

@Belhendo @tobybellwood @simesy

What is GovCMS's proposed action for when a module maintainer is not actively monitoring or updating a module that is part of the GovCMS distro?

The Context module has a number of maintainers listed, but all bar one seems to have not touched it for quite some time. I've tried to contact the one maintainer that seems to still be around, but I'm not sure if he received my message (need to wait and see).

The 'Menu Trail By Path' is a very useful module so it is a shame that another module that is equally very useful isn't being maintained properly and as such causes a WSD.

Is it possible that GovCMS can fork either module as part of the distribution so that both module work in parallel?

What I'm getting at is how can issues like this be avoided when modules in the distro are not properly maintained?