diff options
Diffstat (limited to 'www/drupal8/patches/patch-core_lib_Drupal_Core_Extension_ModulesHandler.php')
-rw-r--r-- | www/drupal8/patches/patch-core_lib_Drupal_Core_Extension_ModulesHandler.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/www/drupal8/patches/patch-core_lib_Drupal_Core_Extension_ModulesHandler.php b/www/drupal8/patches/patch-core_lib_Drupal_Core_Extension_ModulesHandler.php new file mode 100644 index 00000000000..2eee76dae1f --- /dev/null +++ b/www/drupal8/patches/patch-core_lib_Drupal_Core_Extension_ModulesHandler.php @@ -0,0 +1,22 @@ +$NetBSD: patch-core_lib_Drupal_Core_Extension_ModulesHandler.php,v 1.1.2.2 2019/01/29 12:50:28 bsiegert Exp $ + +Avoids UnknownExtensionException: +https://www.drupal.org/project/drupal/issues/3000677 + +--- core/lib/Drupal/Core/Extension/ModuleHandler.php.orig 2019-01-02 21:52:52.000000000 +0000 ++++ core/lib/Drupal/Core/Extension/ModuleHandler.php +@@ -777,7 +777,13 @@ class ModuleHandler implements ModuleHan + * {@inheritdoc} + */ + public function getName($module) { +- return \Drupal::service('extension.list.module')->getName($module); ++ try { ++ return \Drupal::service('extension.list.module')->getName($module); ++ } ++ catch (UnknownExtensionException $e) { ++ @trigger_error('Calling ModuleHandler::getName() with an unknown module is deprecated in Drupal 8.7.0 and support for this will be removed in Drupal 9.0.0, check that the module exists before calling this method. See https://www.drupal.org/node/3024541.', E_USER_DEPRECATED); ++ return $module; ++ } + } + + } |