Too few arguments to function Drupal\Core\Extension\ModuleHandler::invokeAllWith()

Created on 2 January 2024, 6 months ago
Updated 3 January 2024, 6 months ago

I'm upgrading client's site from D9 to D10 and have run into an issue when attempting to run cron:

ArgumentCountError: Too few arguments to function Drupal\Core\Extension\ModuleHandler::invokeAllWith(), 1 passed in /var/www/web/modules/contrib/content_notify/src/ContentNotifyManager.php on line 209 and exactly 2 expected in Drupal\Core\Extension\ModuleHandler->invokeAllWith() (line 385 of core/lib/Drupal/Core/Extension/ModuleHandler.php).

I think I've figured out what the issue is. During the D10 compatibility update, line 209 is updated.

from: foreach ($this->moduleHandler->getImplementations($hook) as $module){
to: foreach ($this->moduleHandler->invokeAllWith($hook) as $module){

After a little digging, it looks like `ModuleHandler::invokeAll` should have been used instead of `ModuleHandle::invokeAllWith`.

Should be a pretty simple patch.

๐Ÿ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States sam.dufrin

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024