Issue #2544922 by borisson_: hook_views_post_render causes "A stray drupal_render() invocation" for anonymous users

8.0.x
Alex Pott 2015-08-09 01:41:14 +01:00
parent 3f7be6b880
commit 3f8677b245
1 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,9 @@
*/
use Drupal\Core\Language\LanguageInterface;
use Drupal\views\Plugin\views\cache\CachePluginBase;
use Drupal\views\Plugin\views\PluginBase;
use Drupal\views\ViewExecutable;
/**
* @defgroup views_overview Views overview
@ -796,12 +798,12 @@ function hook_views_pre_render(ViewExecutable $view) {
* The view object about to be processed.
* @param string $output
* A flat string with the rendered output of the view.
* @param CacheBackendInterface $cache
* @param \Drupal\views\Plugin\views\cache\CachePluginBase $cache
* The cache settings.
*
* @see \Drupal\views\ViewExecutable
*/
function hook_views_post_render(ViewExecutable $view, &$output, CacheBackendInterface $cache) {
function hook_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) {
// When using full pager, disable any time-based caching if there are fewer
// than 10 results.
if ($view->pager instanceof Drupal\views\Plugin\views\pager\Full && $cache instanceof Drupal\views\Plugin\views\cache\Time && count($view->result) < 10) {