diff --git a/core/lib/Drupal/Core/Plugin/Factory/MethodFactory.php b/core/lib/Drupal/Core/Plugin/Factory/MethodFactory.php new file mode 100644 index 0000000..70315ea --- /dev/null +++ b/core/lib/Drupal/Core/Plugin/Factory/MethodFactory.php @@ -0,0 +1,24 @@ +discovery); + return $plugin_class::create(drupal_container(), $configuration, $plugin_id, $this->discovery); + } + +} diff --git a/core/lib/Drupal/Core/Plugin/MethodFactoryPluginBase.php b/core/lib/Drupal/Core/Plugin/MethodFactoryPluginBase.php new file mode 100644 index 0000000..a410e0f --- /dev/null +++ b/core/lib/Drupal/Core/Plugin/MethodFactoryPluginBase.php @@ -0,0 +1,41 @@ +discovery = new AlterDecorator($this->discovery, 'views_plugins_' . $type); $this->discovery = new CacheDecorator($this->discovery, 'views:' . $type, 'views_info'); - $this->factory = new DefaultFactory($this->discovery); + $this->factory = new MethodFactory($this); $this->defaults += array( 'parent' => 'parent', diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php index 8bf057b..0e87da4 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php @@ -8,11 +8,11 @@ namespace Drupal\views\Plugin\views; use Drupal\Component\Plugin\Discovery\DiscoveryInterface; +use Drupal\Core\Plugin\MethodFactoryPluginBase; use Drupal\views\Plugin\views\display\DisplayPluginBase; -use Drupal\Component\Plugin\PluginBase as ComponentPluginBase; use Drupal\views\ViewExecutable; -abstract class PluginBase extends ComponentPluginBase { +abstract class PluginBase extends MethodFactoryPluginBase { /** * Options for this plugin will be held here.