Issue #1604978 by dawehner | tim.plunkett: Fixed views_plugin_cache tests by correcting some get_results_key to get_output_key.
parent
42858f6bb3
commit
6a9ba69baa
|
@ -27,6 +27,24 @@ class views_plugin_cache extends views_plugin {
|
||||||
*/
|
*/
|
||||||
var $table = 'cache_views_data';
|
var $table = 'cache_views_data';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores the cache id used for the results cache, once get_results_key() got
|
||||||
|
* executed.
|
||||||
|
*
|
||||||
|
* @see views_plugin_cache::get_results_key
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $_results_key;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores the cache id used for the output cache, once get_output_key() got
|
||||||
|
* executed.
|
||||||
|
*
|
||||||
|
* @see views_plugin_cache::get_output_key
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $_output_key;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the plugin.
|
* Initialize the plugin.
|
||||||
*
|
*
|
||||||
|
@ -99,7 +117,7 @@ class views_plugin_cache extends views_plugin {
|
||||||
case 'output':
|
case 'output':
|
||||||
$this->gather_headers();
|
$this->gather_headers();
|
||||||
$this->storage['output'] = $this->view->display_handler->output;
|
$this->storage['output'] = $this->view->display_handler->output;
|
||||||
cache($this->table)->set($this->get_results_key(), $this->storage, $this->cache_set_expire($type));
|
cache($this->table)->set($this->get_output_key(), $this->storage, $this->cache_set_expire($type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +148,7 @@ class views_plugin_cache extends views_plugin {
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case 'output':
|
case 'output':
|
||||||
if ($cache = cache($this->table)->get($this->get_results_key())) {
|
if ($cache = cache($this->table)->get($this->get_output_key())) {
|
||||||
if (!$cutoff || $cache->created > $cutoff) {
|
if (!$cutoff || $cache->created > $cutoff) {
|
||||||
$this->storage = $cache->data;
|
$this->storage = $cache->data;
|
||||||
$this->view->display_handler->output = $cache->data['output'];
|
$this->view->display_handler->output = $cache->data['output'];
|
||||||
|
@ -253,7 +271,7 @@ class views_plugin_cache extends views_plugin {
|
||||||
foreach (array('query','count_query') as $index) {
|
foreach (array('query','count_query') as $index) {
|
||||||
// If the default query back-end is used generate SQL query strings from
|
// If the default query back-end is used generate SQL query strings from
|
||||||
// the query objects.
|
// the query objects.
|
||||||
if ($build_info[$index] instanceof SelectQueryInterface) {
|
if ($build_info[$index] instanceof Drupal\Core\Database\Query\Select) {
|
||||||
$query = clone $build_info[$index];
|
$query = clone $build_info[$index];
|
||||||
$query->preExecute();
|
$query->preExecute();
|
||||||
$build_info[$index] = (string)$query;
|
$build_info[$index] = (string)$query;
|
||||||
|
|
|
@ -37,6 +37,14 @@ class views_plugin_display extends views_plugin {
|
||||||
*/
|
*/
|
||||||
var $extender = array();
|
var $extender = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores the rendered output of the display.
|
||||||
|
*
|
||||||
|
* @see view::render
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $output = NULL;
|
||||||
|
|
||||||
function init(&$view, &$display, $options = NULL) {
|
function init(&$view, &$display, $options = NULL) {
|
||||||
$this->view = &$view;
|
$this->view = &$view;
|
||||||
$this->display = &$display;
|
$this->display = &$display;
|
||||||
|
|
Loading…
Reference in New Issue