mglaman / drupal-change-record-triage

Used to triage Drupal change records to ensure phpstan-drupal, drupal-rector, and upgrade_status have appropriate issues.
MIT License
6 stars 0 forks source link

module_load_install() is deprecated #349

Open mglaman opened 1 year ago

mglaman commented 1 year ago

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 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.

bbrala commented 1 year ago

Hmm, but also https://github.com/palantirnet/drupal-rector/pull/211