Upgrade from 2.1 to 23 breaks site

Created on 2 August 2024, 4 months ago
Updated 26 August 2024, 3 months ago

TypeError: Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator::__construct(): Argument #4 ($module_handler) must be of type ?Drupal\Core\Extension\ModuleHandlerInterface, Drupal\Core\Config\ConfigManager given, called in /home/customer/www/grimsbymorris.org.uk/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 in Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator->__construct() (line 51 of modules/contrib/menu_item_role_access/src/MenuItemRoleAccessLinkTreeManipulator.php).

🐛 Bug report
Status

Fixed

Version

2.2

Component

Code

Created by

🇬🇧United Kingdom nickbooth

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @nickbooth
  • Status changed to Postponed: needs info 4 months ago
  • 🇬🇧United Kingdom LiamPower

    Hi @nickbooth,

    I'm unable to replicate this. From the look of your error message your menu_item_role_access.info.yml may be out of date or the service may be being overridden.

    If you can provide further information I will try and help you resolve it.

    Thanks

  • 🇬🇧United Kingdom nickbooth

    Thanks Liam
    I have been using MIRA for a long time and have never had any issue before. I am very much a hobbyist so I don't really understand the internals of Drupal as well as many. It was only this year that I finally bit the bullet and applied Composer and Drupal 10 to my sites.Since then I run composer update "drupal/*" --with-all-dependencies any time any update is required. Wonderful!
    Now I'm having this problem updating MIRA from 2.1 to 2.3. I'll have to update core and other contrib separately until this issue is fixed.
    As I'm far from being an expert I'm not sure what further info I should provide but I really appreciate your offer of help.

  • 🇬🇧United Kingdom LiamPower

    It may be that you have another service redefining menu.default_tree_manipulators again, are you able to search that in your code base and name each of the files that end in services.yml containing that string?

  • 🇬🇧United Kingdom nickbooth

    I found 174 files with filenames ending "services.yml". Only one mentioned "menu.default_tree_manipulators", namely menu_item_role_access.services.yml

  • First commit to issue fork.
  • 🇬🇧United Kingdom littlepixiez

    Hi @nickbooth. So this issue looks like it was introduced in version 2.2 as the dependencies for the menu.default_tree_manipulators service were updated.

    A cache clear should resolve this issue for you -- do you have access to drush on your terminal, to run "drush cr"?

    I have added a commit to add a cache clear as an update hook, as for users who do not have access to drush will need to run update hooks to not hit this issue.

  • Assigned to littlepixiez
  • Status changed to Needs review 4 months ago
  • Issue was unassigned.
  • Status changed to Fixed 4 months ago
  • 🇬🇧United Kingdom LiamPower

    Thank you both!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024