diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 223d234..ee5fdb8 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -8,6 +8,7 @@ use Drupal\Component\Utility\Xss; use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Template\Attribute; /** * Implements hook_preprocess_HOOK() for HTML document templates. @@ -89,11 +90,8 @@ function seven_preprocess_block(&$variables) { if (isset($variables['title_suffix']['contextual_links'])) { unset($variables['title_suffix']['contextual_links']); unset($variables['elements']['#contextual_links']); - foreach ($variables['attributes']['class'] as $key => $class) { - if ($class === 'contextual-region') { - unset($variables['attributes']['class'][$key]); - } - } + $attribute = new Attribute(array('class' => $variables['attributes']['class'])); + $attribute->removeClass('contextual-region'); } }