Commit 4cdc1cc1 authored by catch's avatar catch

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() {
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) {
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) {
// Check for already-cached results.
if (!empty($this->live_preview)) {
$cache = FALSE;
$cache = $this->display_handler->getPlugin('cache', 'none');
}
else {
$cache = $this->display_handler->getPlugin('cache');
}
if ($cache && $cache->cache_get('results')) {
if ($cache->cache_get('results')) {
if ($this->pager->use_pager()) {
$this->pager->total_items = $this->total_rows;
$this->pager->update_page_info();
......@@ -1201,9 +1201,7 @@ public function execute($display_id = NULL) {
// views_plugin_query::execute().
$this->result = array_values($this->result);
$this->_postExecute();
if ($cache) {
$cache->cache_set('results');
}
$cache->cache_set('results');
}
// 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