Skip to content

Instantly share code, notes, and snippets.

View damiankloip's full-sized avatar

Damian Lee damiankloip

View GitHub Profile
<?php
/**
* @todo.
*/
abstract class ActionPluginBase extends PluginBase implements ActionInterface {
/**
* Implements ActionInterface::getParameter().
*/
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));
$query = views_get_disabled_views();
$controller = entity_get_controller('view');
$factory = drupal_container()->get('entity.query');
$query1 = $factory->get('view')
->condition('display.*.display_options.path', NULL, 'IS NOT NULL')
->execute();
$q = $factory->get('view', 'OR');
$q->notExists('disabled');
$and = $q->andConditionGroup()->exists('disabled')->condition('disabled', TRUE, '<>');
$q->condition($and);
dpm($q->execute());
<?php
protected function supportedInterfaceOrClass($data, $format = NULL) {
// If there is a format passed in and specified on the class, check if it is
// correct.
if (isset($format) && isset($this->format) && !in_array($format, $this->format)) {
return FALSE;
}
if (is_object($data)) {
<?php
return is_object($data) && array_filter($this->supportedInterfaceOrClass, function($name) use ($data) {
return $data instanceof $name;
});
diff --git a/lib/Drupal/views_field_view/Plugin/views/field/View.php b/lib/Drupal/views_field_view/Plugin/views/field/View.php
index 567667d..e3b0833 100644
--- a/lib/Drupal/views_field_view/Plugin/views/field/View.php
+++ b/lib/Drupal/views_field_view/Plugin/views/field/View.php
@@ -23,6 +23,34 @@ use Drupal\views\Plugin\views\field\FieldPluginBase;
class View extends FieldPluginBase {
/**
+ * Keeps track of which views are currently being run.
+ *
/**
* Retrieves a list of fields for the current display.
*
* This also takes into account any associated relationships, if they exist.
*
* @param bool $groupable_only
* (optional) TRUE to only return an array of field labels from handlers
* that support the use_string_group_by method, defaults to FALSE.
*
* @return array
diff --git a/core/modules/views/lib/Drupal/views/ViewsDataCache.php b/core/modules/views/lib/Drupal/views/ViewsDataCache.php
index bc5bd02..611e117 100644
--- a/core/modules/views/lib/Drupal/views/ViewsDataCache.php
+++ b/core/modules/views/lib/Drupal/views/ViewsDataCache.php
@@ -128,10 +128,10 @@ public function get($key = NULL) {
}
if (isset($this->storage[$key])) {
- if (!$from_cache) {
+ if (!$from_cache && !isset($this->requestedTables[$key])) {
<?php
$times = array();
for ($i = 0; $i <= 10; $i++) {
$view = views_get_view('frontpage');
timer_start('damian');
for ($i = 0; $i <= 100; $i++) {
$view->setDisplay('page_1');