diff --git a/core/lib/Drupal/Core/Extension/ProceduralCall.php b/core/lib/Drupal/Core/Extension/ProceduralCall.php index 5969a80df7d..db6b591f227 100644 --- a/core/lib/Drupal/Core/Extension/ProceduralCall.php +++ b/core/lib/Drupal/Core/Extension/ProceduralCall.php @@ -20,18 +20,6 @@ final class ProceduralCall { } - /** - * Calls a function in the root namespace. - * - * __call() does not support references https://bugs.php.net/bug.php?id=71256 - * Because of this, ModuleHandler::getHookListeners() inlines this - * method so it is not called anywhere in core. - */ - public function __call($name, $args): mixed { - $this->loadFile($name); - return ('\\' . $name)(... $args); - } - /** * Loads the file a function lives in, if any. * diff --git a/core/modules/views/src/DisplayPluginCollection.php b/core/modules/views/src/DisplayPluginCollection.php index 74b69103d66..41eb2dc76e6 100644 --- a/core/modules/views/src/DisplayPluginCollection.php +++ b/core/modules/views/src/DisplayPluginCollection.php @@ -5,6 +5,7 @@ namespace Drupal\views; use Drupal\Component\Plugin\Exception\PluginException; use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Core\Plugin\DefaultLazyPluginCollection; +use Drupal\views\Plugin\views\display\DisplayPluginInterface; /** * A class which wraps the displays of a view so you can lazy-initialize them. @@ -59,7 +60,9 @@ class DisplayPluginCollection extends DefaultLazyPluginCollection { */ public function clear() { foreach (array_filter($this->pluginInstances) as $display) { - $display->destroy(); + if ($display instanceof DisplayPluginInterface) { + $display->destroy(); + } } parent::clear();