Skip to content
Snippets Groups Projects
Commit 6a9ba69b authored by Daniel Wehner's avatar Daniel Wehner Committed by Tim Plunkett
Browse files

Issue #1604978 by dawehner | tim.plunkett: Fixed views_plugin_cache tests by...

Issue #1604978 by dawehner | tim.plunkett: Fixed views_plugin_cache tests by correcting some get_results_key to get_output_key.
parent 42858f6b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -27,6 +27,24 @@ class views_plugin_cache extends views_plugin {
*/
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.
*
......@@ -99,7 +117,7 @@ function cache_set($type) {
case 'output':
$this->gather_headers();
$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;
}
}
......@@ -130,7 +148,7 @@ function cache_get($type) {
}
return FALSE;
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) {
$this->storage = $cache->data;
$this->view->display_handler->output = $cache->data['output'];
......@@ -253,7 +271,7 @@ function get_results_key() {
foreach (array('query','count_query') as $index) {
// If the default query back-end is used generate SQL query strings from
// 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->preExecute();
$build_info[$index] = (string)$query;
......
......@@ -37,6 +37,14 @@ class views_plugin_display extends views_plugin {
*/
var $extender = array();
/**
* Stores the rendered output of the display.
*
* @see view::render
* @var string
*/
public $output = NULL;
function init(&$view, &$display, $options = NULL) {
$this->view = &$view;
$this->display = &$display;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment