diff --git a/core/modules/block/block.module b/core/modules/block/block.module index b577124..94c0304 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -514,7 +514,8 @@ function template_preprocess_block(&$variables) { $variables['attributes']['class'][] = 'block'; $variables['attributes']['class'][] = drupal_html_class($variables['configuration']['module']); - $variables['attributes']['class'][] = drupal_html_class($variables['plugin_id']); + $plugin_id_class = str_replace(':', '--', $variables['plugin_id']); + $variables['attributes']['class'][] = drupal_html_class($plugin_id_class); $variables['attributes']['id'] = drupal_html_id('block-' . $variables['elements']['#block']->id()); // The block template provides a wrapping element for the content. Render the diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php index ab185a9..15f98f2 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockHtmlIdTest.php @@ -49,7 +49,7 @@ function setUp() { function testHtmlId() { $this->drupalGet(''); $this->assertRaw('id="block-test-id-block"', 'HTML ID for test block is valid.'); - $elements = $this->xpath('//div[contains(@class, :div-class)]/div/ul[contains(@class, :ul-class)]/li', array(':div-class' => 'system-menu-blocktools', ':ul-class' => 'menu')); + $elements = $this->xpath('//div[contains(@class, :div-class)]/div/ul[contains(@class, :ul-class)]/li', array(':div-class' => 'system-menu-block--tools', ':ul-class' => 'menu')); $this->assertTrue(!empty($elements), 'The proper block markup was found.'); }