Skip to content
Snippets Groups Projects
Commit e9999f7d authored by mxh's avatar mxh
Browse files

Issue #3323764 by mxh: eca_views: Export and execute do not work for display variants

parent 4535dc1b
Branches
Tags
1 merge request!261Issue #3323764: eca_views: Export and execute do not work for display variants
......@@ -30,14 +30,15 @@ class ViewsExport extends ViewsQuery {
* {@inheritdoc}
*/
public function execute($object = NULL): void {
if (!($display = $this->getDisplay())) {
if (!$this->getDisplay() || !isset($this->view)) {
return;
}
if ($this->configuration['load_results_into_token']) {
parent::execute();
}
else {
$display->execute();
$this->view->preExecute();
$this->view->execute();
}
$this->view->display_handler->buildRenderable($this->view->args, FALSE);
/** @var \Drupal\Core\Render\RendererInterface $renderer */
......
......@@ -47,10 +47,11 @@ class ViewsQuery extends ConfigurableActionBase {
* {@inheritdoc}
*/
public function execute($object = NULL): void {
if (!($display = $this->getDisplay())) {
if (!$this->getDisplay() || !isset($this->view)) {
return;
}
$display->execute();
$this->view->preExecute();
$this->view->execute();
$token_name = trim($this->configuration['token_name']);
if ($token_name === '') {
$token_name = implode(':', [
......@@ -155,8 +156,7 @@ class ViewsQuery extends ConfigurableActionBase {
*/
protected function getDisplay(): ?DisplayPluginBase {
$view_id = $this->getViewId();
$display_id = $this->getDisplayId();
if ($view_id === '' || $display_id === '') {
if ($view_id === '') {
return NULL;
}
......@@ -166,8 +166,15 @@ class ViewsQuery extends ConfigurableActionBase {
}
$this->view = $view->getExecutable();
if (!$this->view->setDisplay($this->getDisplayId())) {
return NULL;
$display_id = $this->getDisplayId();
if ($display_id !== '') {
if (!$this->view->setDisplay($display_id)) {
return NULL;
}
}
else {
$this->view->initDisplay();
}
$args = [];
......@@ -177,6 +184,7 @@ class ViewsQuery extends ConfigurableActionBase {
}
}
$this->view->setArguments($args);
return $this->view->getDisplay();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment