Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module_load_install() is deprecated #349

Open
mglaman opened this issue Apr 21, 2023 · 1 comment
Open

module_load_install() is deprecated #349

mglaman opened this issue Apr 21, 2023 · 1 comment
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

Comments

@mglaman
Copy link
Owner

mglaman commented Apr 21, 2023

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.

@mglaman mglaman added 9.4.x phpstan-drupal This needs phpstan-drupal changes drupal-rector phpstan-deprecations Will be detected with PHPStan's deprecation rules and removed phpstan-drupal This needs phpstan-drupal changes labels Apr 21, 2023
@bbrala
Copy link
Collaborator

bbrala commented Aug 17, 2023

Hmm, but also palantirnet/drupal-rector#211

@bbrala bbrala added this to the 9.4.x coverage milestone Sep 5, 2023
@bbrala bbrala added the drupal-rector-covered This issue is covered in rector label Dec 23, 2023
@bbrala bbrala added the archived Issues that are unlikely to work on in the future label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants