Skip to content
Snippets Groups Projects

Check for null block.

1 file
+ 7
1
Compare changes
  • Side-by-side
  • Inline
@@ -24,7 +24,13 @@ function civictheme_preprocess_block__system_branding_block(array &$variables):
$variables['show_site_name'] = !empty($variables['elements']['#configuration']['use_site_name']);
$variables['show_site_slogan'] = !empty($variables['elements']['#configuration']['use_site_slogan']);
$is_footer_region = !empty($variables['elements']['#id']) && str_starts_with(Block::load($variables['elements']['#id'])->getRegion(), 'footer');
$is_footer_region = false;
if (!empty($variables['elements']['#id'])) {
$block = Block::load($variables['elements']['#id']);
if ($block) {
$is_footer_region = str_starts_with($block->getRegion(), 'footer');
}
}
$theme = $is_footer_region
? civictheme_get_theme_config_manager()->load('components.footer.theme', CivicthemeConstants::FOOTER_THEME_DEFAULT)
Loading