Deprecations and TypeErrors with PHP 8.4

Created on 12 February 2025, about 2 months ago

Problem/Motivation

Updating to PHP 8.4, I got a WSOD with the notice:
PHP Deprecated: Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator::__construct(): Implicitly marking parameter $module_handler as nullable is deprecated, the explicit nullable type must be used instead in X:\xxx\xxxx\web\modules\contrib\menu_item_role_access\src\MenuItemRoleAccessLinkTreeManipulator.php on line 53

After prepending a ? to ModuleHandlerInterface to make it explicitly nullable, I get another WSOD with the notice:
PHP Deprecated: Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator::__construct(): Optional parameter $module_handler declared before required parameter $entity_repository is implicitly treated as a required parameter in X:\xxx\xxxx\web\modules\contrib\menu_item_role_access\src\MenuItemRoleAccessLinkTreeManipulator.php on line 53

After rearranging the parameters so that the optional parameter $module_handler is at the end of the list, I get another WSOD with the following:
Uncaught PHP Exception TypeError: "Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator::__construct(): Argument #4 ($config_manager) must be of type Drupal\Core\Config\ConfigManagerInterface, Drupal\Core\Extension\ModuleHandler given, called in X:\xxx\xxxx\web\core\lib\Drupal\Component\DependencyInjection\Container.php on line 261" at C:\Web_Projects\oar-mosaic-as-a-service\web\modules\contrib\menu_item_role_access\src\MenuItemRoleAccessLinkTreeManipulator.php line 53.

Argument #4 is $config_manager, and ModuleHandler is at the end of the list.

Steps to reproduce

See above.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.4

Component

Code

Created by

🇺🇸United States wlc13

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024