Commit 4cdc1cc1 authored by catch's avatar catch
Browse files

Issue #1809222 by dawehner: Replace specific cache behavior in...

Issue #1809222 by dawehner: Replace specific cache behavior in viewExecuteable::execute with None cache plugin.
parent a93b6375
...@@ -29,10 +29,22 @@ public function summaryTitle() { ...@@ -29,10 +29,22 @@ public function summaryTitle() {
return t('None'); return t('None');
} }
/**
* Overrides \Drupal\views\Plugin\views\cache\CachePluginBase::cache_get().
*
* Replace the cache get logic so it does not return a cache item at all.
*/
function cache_get($type) { function cache_get($type) {
return FALSE; return FALSE;
} }
function cache_set($type) { } /**
* Overrides \Drupal\views\Plugin\views\cache\CachePluginBase::cache_set().
*
* Replace the cache set logic so it does set a cache item at all.
*/
function cache_set($type) {
}
} }
...@@ -1184,12 +1184,12 @@ public function execute($display_id = NULL) { ...@@ -1184,12 +1184,12 @@ public function execute($display_id = NULL) {
// Check for already-cached results. // Check for already-cached results.
if (!empty($this->live_preview)) { if (!empty($this->live_preview)) {
$cache = FALSE; $cache = $this->display_handler->getPlugin('cache', 'none');
} }
else { else {
$cache = $this->display_handler->getPlugin('cache'); $cache = $this->display_handler->getPlugin('cache');
} }
if ($cache && $cache->cache_get('results')) { if ($cache->cache_get('results')) {
if ($this->pager->use_pager()) { if ($this->pager->use_pager()) {
$this->pager->total_items = $this->total_rows; $this->pager->total_items = $this->total_rows;
$this->pager->update_page_info(); $this->pager->update_page_info();
...@@ -1201,9 +1201,7 @@ public function execute($display_id = NULL) { ...@@ -1201,9 +1201,7 @@ public function execute($display_id = NULL) {
// views_plugin_query::execute(). // views_plugin_query::execute().
$this->result = array_values($this->result); $this->result = array_values($this->result);
$this->_postExecute(); $this->_postExecute();
if ($cache) { $cache->cache_set('results');
$cache->cache_set('results');
}
} }
// Let modules modify the view just after executing it. // Let modules modify the view just after executing it.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment