Issue #1809222 by dawehner: Replace specific cache behavior in viewExecuteable::execute with None cache plugin.

8.0.x
catch 2012-11-02 19:44:51 +00:00
parent a93b6375b8
commit 4cdc1cc1bb
2 changed files with 16 additions and 6 deletions

View File

@ -29,10 +29,22 @@ class None extends CachePluginBase {
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) {
}
}

View File

@ -1184,12 +1184,12 @@ class ViewExecutable {
// 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 @@ class ViewExecutable {
// 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.