diff --git a/core/includes/module.inc b/core/includes/module.inc index c938a17df99..02a4f5d41f3 100644 --- a/core/includes/module.inc +++ b/core/includes/module.inc @@ -40,7 +40,7 @@ * @see https://www.drupal.org/node/2948698 */ function module_load_include($type, $module, $name = NULL) { - @trigger_error("module_load_include() is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. Instead, you should use \Drupal::moduleHandler()->loadInclude(). Note that including code from uninstalled extensions is no longer supported. See https://www.drupal.org/project/drupal/issues/697946", E_USER_DEPRECATED); + @trigger_error("module_load_include() is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. Instead, you should use \Drupal::moduleHandler()->loadInclude(). Note that including code from uninstalled extensions is no longer supported. See https://www.drupal.org/node/2948698", E_USER_DEPRECATED); if (!isset($name)) { $name = $module; } diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleLegacyTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleLegacyTest.php index 1b281c286a7..58c89fcd028 100644 --- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleLegacyTest.php +++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleLegacyTest.php @@ -16,7 +16,7 @@ class ModuleLegacyTest extends KernelTestBase { */ public function testModuleLoadInclude() { $this->assertFalse($this->container->get('module_handler')->moduleExists('module_test'), 'Ensure module is uninstalled so we test the ability to include uninstalled code.'); - $this->expectDeprecation('module_load_include() is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. Instead, you should use \Drupal::moduleHandler()->loadInclude(). Note that including code from uninstalled extensions is no longer supported. See https://www.drupal.org/project/drupal/issues/697946'); + $this->expectDeprecation('module_load_include() is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. Instead, you should use \Drupal::moduleHandler()->loadInclude(). Note that including code from uninstalled extensions is no longer supported. See https://www.drupal.org/node/2948698'); $filename = module_load_include('inc', 'module_test', 'module_test.file'); $this->assertStringEndsWith("module_test.file.inc", $filename);