diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index f91c5cc..6056350 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1549,6 +1549,7 @@ function template_preprocess_table(&$variables) {
$responsive_classes = array();
// Format the table header:
+ $ts =array();
if (!empty($variables['header'])) {
$ts = tablesort_init($variables['header']);
@@ -1599,13 +1600,11 @@ function template_preprocess_table(&$variables) {
// Format the table footer:
if (!empty($variables['footer'])) {
- $ts = tablesort_init($variables['footer']);
foreach ($variables['footer'] as $col_key => $cell) {
if (!is_array($cell)) {
$cell_content = $cell;
$cell_attributes = new Attribute();
- $is_footer = TRUE;
}
else {
$cell_content = '';
@@ -1614,7 +1613,6 @@ function template_preprocess_table(&$variables) {
unset($cell['data']);
}
// Flag the cell as a footer or not and remove the flag.
- $is_footer = isset($cell['footer']) ? $cell['footer'] : TRUE;
unset($cell['footer']);
// Track responsive classes for each column as needed. Only the footer
@@ -1633,10 +1631,6 @@ function template_preprocess_table(&$variables) {
if (is_array($cell_content)) {
$cell_content = drupal_render($cell_content);
}
-
- tablesort_footer($cell_content, $cell, $variables['footer'], $ts);
-
- // tablesort_footer() removes the 'sort' and 'field' keys.
$cell_attributes = new Attribute($cell);
}
$variables['footer'][$col_key] = array();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
index 6b9c5ef..80f5f90 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php
@@ -86,15 +86,24 @@ function testThemeTableWithEmptyMessage() {
'colspan' => 2,
),
);
+ $footer = array(
+ 'Footer 1',
+ array(
+ 'data' => 'Footer 2',
+ 'colspan' => 2,
+ ),
+ );
$table = array(
'#type' => 'table',
'#header' => $header,
+ '#footer' => $footer,
'#rows' => array(),
'#empty' => 'Empty row.',
);
$this->render($table);
$this->removeWhiteSpace();
$this->assertRaw(' ', 'Table header found.');
+ $this->assertRaw('Header 1 Header 2