Skip to content
Snippets Groups Projects

Fixed error when adding block while no block categories are defined

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -214,7 +214,7 @@ class BrowserController extends ControllerBase {
$block_categories[$bundle_label]['links'] = $block_links;
$block_categories[$bundle_label]['#type'] = 'details';
$block_categories[$bundle_label]['#attributes']['class'][] = 'js-layout-builder-category';
$block_categories[$bundle_label]['#open'] = $blockcat->getOpened();
$block_categories[$bundle_label]['#open'] = isset($blockcat) ? $blockcat->getOpened() : TRUE;
$block_categories[$bundle_label]['#title'] = $this->t('Reusable @block_type_label', ['@block_type_label' => $bundle_label]);
}
}
Loading