diff --git a/core/includes/theme.inc b/core/includes/theme.inc index cc60af2..de83cc3 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2089,7 +2089,12 @@ function theme_table($variables) { drupal_add_library('system', 'drupal.tableheader'); // Add 'sticky-enabled' class to the table to identify it for JS. // This is needed to target tables constructed by this function. - $attributes['class'][] = 'sticky-enabled'; + if (isset($table_attributes['class'])) { + $table_attributes['class'][] = 'sticky-enabled'; + } + else { + $table_attributes['class'] = array('sticky-enabled'); + } } // If the table has headers and it should react responsively to columns hidden // with the classes represented by the constants RESPONSIVE_PRIORITY_MEDIUM @@ -2098,7 +2103,12 @@ function theme_table($variables) { drupal_add_library('system', 'drupal.tableresponsive'); // Add 'responsive-enabled' class to the table to identify it for JS. // This is needed to target tables constructed by this function. - $attributes['class'][] = 'responsive-enabled'; + if (isset($table_attributes['class'])) { + $table_attributes['class'][] = 'responsive-enabled'; + } + else { + $table_attributes['class'] = array('responsive-enabled'); + } } $output = '\n"; diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php index d0c833a..5a14aaf 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php @@ -138,11 +138,13 @@ protected function renderTests() { // Test the rendering of a block. $output = entity_view($entity, 'block'); $expected = array(); - $expected[] = '
'; - $expected[] = ''; + $expected[] = '
'; + $expected[] = ' '; $expected[] = ' '; + $expected[] = ''; $expected[] = '
'; - $expected[] = '
'; + $expected[] = ' '; + $expected[] = '
'; $expected[] = '
'; $expected[] = ''; $expected_output = implode("\n", $expected); @@ -155,12 +157,14 @@ protected function renderTests() { $entity->set('label', 'Powered by Bananas'); $output = entity_view($entity, 'block'); $expected = array(); - $expected[] = '
'; - $expected[] = ''; - $expected[] = '

Powered by Bananas

'; + $expected[] = '
'; $expected[] = ' '; + $expected[] = '

Powered by Bananas

'; + $expected[] = ' '; + $expected[] = ''; $expected[] = '
'; - $expected[] = '
'; + $expected[] = ' '; + $expected[] = '
'; $expected[] = '
'; $expected[] = ''; $expected_output = implode("\n", $expected); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php index c469eb6..7b49110 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php @@ -51,11 +51,8 @@ function testBlockThemeHookSuggestions() { 'module' => $block->get('module'), ); $variables['elements']['#children'] = ''; - // Test adding a class to the block content. - $variables['content_attributes']['class'][] = 'test-class'; template_preprocess_block($variables); $this->assertEqual($variables['theme_hook_suggestions'], array('block__footer', 'block__system', 'block__system_menu_block', 'block__system_menu_block__menu_admin', 'block__machinename')); - $this->assertEqual($variables['content_attributes']['class'], array('test-class', 'content'), 'Default .content class added to block content_attributes_array'); } }