module_load_install() is deprecated #349
Labels
9.4.x
archived
Issues that are unlikely to work on in the future
drupal-rector-covered
This issue is covered in rector
phpstan-deprecations
Will be detected with PHPStan's deprecation rules
Milestone
https://www.drupal.org/node/3220952
Introduced in branch/version: 9.4.x / 9.4.0
Summary
The function
module_load_install($module)
is deprecated in Drupal 9.4.x and will be removed before Drupal 10.0.0. This function is currently found incore/includes/module.inc
.It is replaced by
ModuleHandler::loadInclude($module, 'install')
. The arguments and return values are unchanged. See \Drupal\Core\Extension\ModuleHandlerBefore
module_load_install($module)
After
In procedural code:
\Drupal::moduleHandler()->loadInclude($module, 'install');
In OO code:
Inject the
module_handler
service and invoke theloadInclude($module, 'install')
method on the injected service instead of using the static\Drupal::moduleHandler()
call.The text was updated successfully, but these errors were encountered: