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 in core/includes/module.inc.
It is replaced by ModuleHandler::loadInclude($module, 'install'). The arguments and return values are unchanged. See \Drupal\Core\Extension\ModuleHandler
Before
module_load_install($module)
After
In procedural code: \Drupal::moduleHandler()->loadInclude($module, 'install');
In OO code:
Inject the module_handler service and invoke the loadInclude($module, 'install') method on the injected service instead of using the static \Drupal::moduleHandler() call.
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.