diff -u b/menu_block.module b/menu_block.module --- b/menu_block.module +++ b/menu_block.module @@ -115,15 +115,8 @@ if (isset($variables['content']['#menu_block_configuration']['label'])) { $config_label = $variables['content']['#menu_block_configuration']['label']; - // Some block twig templates (especially classy + bartik from core) use - // `{{ configuration.label }}` to print the label. Others just use - // `{{ label }}`. Therefore, we have to set both template variables for - // this to work consistently. + // Label is set to empty string unless configured to be visible. $variables['label'] = !empty($variables['configuration']['label_display']) ? $config_label : ''; - } - // Even without $variables['content']['#menu_block_configuration']['label'] we - // need to change the label. For example, this happens when there are no menu - // items to render. But we still need to set the block label. - if (isset($variables['label'])) { - $variables['configuration']['label'] = $variables['label']; + // Configuration label is set regardless. + $variables['configuration']['label'] = $config_label; } }