commit cb4437c7793053230a892ff9a28e93c37e954b2a Author: Joel Pittet Date: Thu Aug 20 12:58:37 2015 -0700 fixes diff --git a/core/modules/views/templates/views-view-table.html.twig b/core/modules/views/templates/views-view-table.html.twig index fe6be75..3dde8c2 100644 --- a/core/modules/views/templates/views-view-table.html.twig +++ b/core/modules/views/templates/views-view-table.html.twig @@ -72,7 +72,11 @@ %} {% endif %} - {{ column.content }} + {%- if column.wrapper_element -%} + <{{ column.wrapper_element }}>{{ column.content }}{{ column.sort_indicator }} + {%- else -%} + {{ column.content }}{{ column.sort_indicator }} + {%- endif %} {% endfor %} @@ -93,7 +97,12 @@ {% endfor %} {% endif %} - {{ column.content }} + {{- column.content }}{{ column.separator -}} + {%- if column.wrapper_element -%} + <{{ column.wrapper_element }}>{{ column.field_output }} + {%- else -%} + {{- column.field_output -}} + {%- endif %} {% endfor %} diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 36be654..45bf25d 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -469,7 +469,7 @@ function template_preprocess_views_view_table(&$variables) { // Render the header labels. if ($field == $column && empty($fields[$field]->options['exclude'])) { - $label = SafeMarkup::checkPlain(!empty($fields[$field]) ? $fields[$field]->label() : ''); + $label = !empty($fields[$field]) ? $fields[$field]->label() : ''; if (empty($options['info'][$field]['sortable']) || !$fields[$field]->clickSortable()) { $variables['header'][$field]['content'] = $label; } @@ -482,11 +482,10 @@ function template_preprocess_views_view_table(&$variables) { $title = t('sort by @s', array('@s' => $label)); if ($active == $field) { - $tablesort_indicator = array( + $variables['header'][$field]['sort_indicator'] = array( '#theme' => 'tablesort_indicator', '#style' => $initial, ); - $label = [['#markup' => $label], $tablesort_indicator]; } $query['order'] = $field; @@ -520,7 +519,7 @@ function template_preprocess_views_view_table(&$variables) { if ($variables['header'][$field]['content']) { $element_label_type = $fields[$field]->elementLabelType(TRUE, TRUE); if ($element_label_type) { - $variables['header'][$field]['content'] = '<' . $element_label_type . '>' . $variables['header'][$field]['content'] . ''; + $variables['header'][$field]['wrapper_element'] = $element_label_type; } // Improves accessibility of complex tables. $variables['header'][$field]['attributes']['id'] = Html::getUniqueId('view-' . $field . '-table-column'); @@ -579,12 +578,7 @@ function template_preprocess_views_view_table(&$variables) { $field_output = $handler->getField($num, $field); $element_type = $fields[$field]->elementType(TRUE, TRUE); if ($element_type) { - $tagged_output = array( - '#type' => 'html_tag', - '#tag' => $element_type, - '#value' => $field_output - ); - $field_output = drupal_render($tagged_output); + $column_reference['wrapper_element'] = $element_type; } // Only bother with separators and stuff if the field shows up. @@ -592,14 +586,13 @@ function template_preprocess_views_view_table(&$variables) { // Place the field into the column, along with an optional separator. if (!empty($column_reference['content'])) { if (!empty($options['info'][$column]['separator'])) { - $safe_separator = Xss::filterAdmin($options['info'][$column]['separator']); - $column_reference['content'] = SafeMarkup::format('@content@separator', ['@content' => $column_reference['content'], '@separator' => $safe_separator]); + $column_reference['separator'] = Xss::filterAdmin($options['info'][$column]['separator']); } } else { $column_reference['content'] = ''; } - $column_reference['content'] = SafeMarkup::format('@content@field_output', ['@content' => $column_reference['content'], '@field_output' => $field_output]); + $column_reference['field_output'] = $field_output; } } $column_reference['attributes'] = new Attribute($column_reference['attributes']);