Skip to content
Snippets Groups Projects
Commit 46f8d46a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2633388 by mparker17: Document why ViewsBlock::build() explicitly asks for an un-cached view

parent 5ea2d135
Branches
Tags
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
...@@ -28,6 +28,9 @@ class ViewsBlock extends ViewsBlockBase { ...@@ -28,6 +28,9 @@ class ViewsBlock extends ViewsBlockBase {
public function build() { public function build() {
$this->view->display_handler->preBlockBuild($this); $this->view->display_handler->preBlockBuild($this);
// We ask ViewExecutable::buildRenderable() to avoid creating a render cache
// entry for the view output by passing FALSE, because we're going to cache
// the whole block instead.
if ($output = $this->view->buildRenderable($this->displayID, [], FALSE)) { if ($output = $this->view->buildRenderable($this->displayID, [], FALSE)) {
// Override the label to the dynamic title configured in the view. // Override the label to the dynamic title configured in the view.
if (empty($this->configuration['views_label']) && $this->view->getTitle()) { if (empty($this->configuration['views_label']) && $this->view->getTitle()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment