Created
January 23, 2013 13:26
-
-
Save damiankloip/4605569 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php | |
index bf7eca2..ed0681e 100644 | |
--- a/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php | |
+++ b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php | |
@@ -139,7 +139,7 @@ class View extends ConfigEntityBase implements ViewStorageInterface { | |
public function get($property_name, $langcode = NULL) { | |
// Ensure that an executable View is available. | |
if ($property_name == 'executable' && !isset($this->{$property_name})) { | |
- $this->set('executable', new ViewExecutable($this)); | |
+ $this->set('executable', drupal_container()->get('views.executable')->get($this)); | |
} | |
return parent::get($property_name, $langcode); | |
diff --git a/core/modules/views/lib/Drupal/views/ViewExecutableFactory.php b/core/modules/views/lib/Drupal/views/ViewExecutableFactory.php | |
new file mode 100644 | |
index 0000000..3be06a9 | |
--- /dev/null | |
+++ b/core/modules/views/lib/Drupal/views/ViewExecutableFactory.php | |
@@ -0,0 +1,32 @@ | |
+<?php | |
+ | |
+/** | |
+ * @file | |
+ * Contains \Drupal\views\ViewExecutableFactory. | |
+ */ | |
+ | |
+namespace Drupal\views; | |
+ | |
+use Drupal\views\Plugin\Core\Entity\View; | |
+ | |
+/** | |
+ * Defines the cache backend factory. | |
+ */ | |
+class ViewExecutableFactory { | |
+ | |
+ /** | |
+ * Instantiates a view executable class. | |
+ * | |
+ * @param \Drupal\views\Plugin\Core\Entity\View $view | |
+ * A view entity instance. | |
+ * | |
+ * @return Drupal\views\ViewExecutable | |
+ * A ViewExecutable instance. | |
+ */ | |
+ public static function get(View $view) { | |
+ global $conf; | |
+ $class = isset($conf['view_executable_class']) ? $conf['view_executable_class'] : 'Drupal\views\ViewExecutable'; | |
+ return new $class($view); | |
+ } | |
+ | |
+} | |
diff --git a/core/modules/views/lib/Drupal/views/ViewsBundle.php b/core/modules/views/lib/Drupal/views/ViewsBundle.php | |
index 544b8c3..057719f 100644 | |
--- a/core/modules/views/lib/Drupal/views/ViewsBundle.php | |
+++ b/core/modules/views/lib/Drupal/views/ViewsBundle.php | |
@@ -26,6 +26,8 @@ public function build(ContainerBuilder $container) { | |
->addArgument($type); | |
} | |
+ $container->register('views.executable', 'Drupal\views\ViewExecutableFactory'); | |
+ | |
$container | |
->register('cache.views_info', 'Drupal\Core\Cache\CacheBackendInterface') | |
->setFactoryClass('Drupal\Core\Cache\CacheFactory') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment