Skip to content
Snippets Groups Projects
Commit a942961f authored by Erik Seifert's avatar Erik Seifert
Browse files

Issue #3295719 by pefferen, Erik Seifert: Exception thrown when uses does not...

Issue #3295719 by pefferen, Erik Seifert: Exception thrown when uses does not have permision to view Views Block
parent cfb20ee2
No related branches found
Tags 8.x-1.0-beta5
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