diff --git a/core/modules/views/src/Plugin/Block/ViewsBlock.php b/core/modules/views/src/Plugin/Block/ViewsBlock.php index ee3cec1..46e0069 100644 --- a/core/modules/views/src/Plugin/Block/ViewsBlock.php +++ b/core/modules/views/src/Plugin/Block/ViewsBlock.php @@ -27,29 +27,24 @@ public function build() { $args = []; foreach ($this->view->display_handler->getHandlers('argument') as $argument_name => $argument) { /** @var \Drupal\views\Plugin\views\argument\ArgumentPluginBase $argument */ + $args[$argument_name] = NULL; if (!empty($this->context[$argument_name])) { if (($value = $this->context[$argument_name]->getContextValue())) { if ($value instanceof EntityInterface) { $value = $value->id(); } - $args[] = $value; + $args[$argument_name] = $value; } elseif ($argument->options['default_action'] == 'ignore') { - $args[] = $argument->options['exception']['value']; + $args[$argument_name] = $argument->options['exception']['value']; } - else { - $args[] = NULL; - } - } - else { - $args[] = NULL; } } // 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, $args, FALSE)) { + if ($output = $this->view->buildRenderable($this->displayID, array_values($args), FALSE)) { // Override the label to the dynamic title configured in the view. if (empty($this->configuration['views_label']) && $this->view->getTitle()) { $output['#title'] = ['#markup' => $this->view->getTitle(), '#allowed_tags' => Xss::getHtmlTagList()];