Skip to content
Snippets Groups Projects
Commit 459fe64f authored by Patrick van Efferen's avatar Patrick van Efferen Committed by Erik Seifert
Browse files

Issue #3295719 by pefferen: Exception thrown when uses does not have permision...

Issue #3295719 by pefferen: Exception thrown when uses does not have permision to view Views Block' --author="pefferen <pefferen@993376.no-reply.drupal.org>w
parent 596fe4e5
No related branches found
Tags 1.14.0 8.x-1.14
No related merge requests found
......@@ -84,18 +84,25 @@ class DashboardBlock extends BlockBase implements ContainerFactoryPluginInterfac
* Set if this block is in preview.
*/
public function build() {
return [
'#type' => 'container',
'#attached' => [
'library' => [
'dashboards/component',
$renderArray = [];
$contentRenderArray = $this->basePlugin->buildRenderArray($this->getConfiguration());
if ($contentRenderArray !== []) {
$renderArray = [
'#type' => 'container',
'#attached' => [
'library' => [
'dashboards/component',
],
],
'#attributes' => [
'class' => ['dashboard-component'],
],
],
'#attributes' => [
'class' => ['dashboard-component'],
],
'content' => $this->basePlugin->buildRenderArray($this->getConfiguration()),
];
'content' => $contentRenderArray,
];
}
return $renderArray;
}
}
......@@ -60,7 +60,7 @@ class ViewEmbed extends DashboardBase {
'#markup' => 'View do not exist anymore',
];
}
return views_embed_view($viewId[0], $viewId[1]);
return (views_embed_view($viewId[0], $viewId[1])) ?? [];
}
/**
......
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