Loading core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,8 @@ public function testGrouping() { // Ensure that we don't find the caption containing unsafe markup. $this->assertNoRaw($unsafe_markup, "Didn't find caption containing unsafe markup."); // Ensure that the summary isn't shown. $this->assertEmpty($this->xpath('//caption/details')); // Ensure that all expected captions are found. foreach ($expected_captions as $raw_caption) { Loading core/modules/views/views.theme.inc +15 −13 Original line number Diff line number Diff line Loading @@ -664,11 +664,12 @@ function template_preprocess_views_view_table(&$variables) { // variables, although core templates now all use 'summary_element' instead. $variables['summary'] = $handler->options['summary']; $variables['description'] = $handler->options['description']; if (!empty($handler->options['summary']) || !empty($handler->options['description'])) { $variables['summary_element'] = [ '#type' => 'details', '#title' => $handler->options['summary'], // To ensure that the description is properly escaped during rendering, use // an 'inline_template' to let Twig do its magic, instead of 'markup'. // To ensure that the description is properly escaped during rendering, // use an 'inline_template' to let Twig do its magic, instead of 'markup'. 'description' => [ '#type' => 'inline_template', '#template' => '{{ description }}', Loading @@ -677,7 +678,8 @@ function template_preprocess_views_view_table(&$variables) { ], ], ]; $variables['caption_needed'] |= !empty($variables['summary']) || !empty($variables['description']); $variables['caption_needed'] = TRUE; } $variables['responsive'] = FALSE; // If the table has headers and it should react responsively to columns hidden Loading Loading
core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,8 @@ public function testGrouping() { // Ensure that we don't find the caption containing unsafe markup. $this->assertNoRaw($unsafe_markup, "Didn't find caption containing unsafe markup."); // Ensure that the summary isn't shown. $this->assertEmpty($this->xpath('//caption/details')); // Ensure that all expected captions are found. foreach ($expected_captions as $raw_caption) { Loading
core/modules/views/views.theme.inc +15 −13 Original line number Diff line number Diff line Loading @@ -664,11 +664,12 @@ function template_preprocess_views_view_table(&$variables) { // variables, although core templates now all use 'summary_element' instead. $variables['summary'] = $handler->options['summary']; $variables['description'] = $handler->options['description']; if (!empty($handler->options['summary']) || !empty($handler->options['description'])) { $variables['summary_element'] = [ '#type' => 'details', '#title' => $handler->options['summary'], // To ensure that the description is properly escaped during rendering, use // an 'inline_template' to let Twig do its magic, instead of 'markup'. // To ensure that the description is properly escaped during rendering, // use an 'inline_template' to let Twig do its magic, instead of 'markup'. 'description' => [ '#type' => 'inline_template', '#template' => '{{ description }}', Loading @@ -677,7 +678,8 @@ function template_preprocess_views_view_table(&$variables) { ], ], ]; $variables['caption_needed'] |= !empty($variables['summary']) || !empty($variables['description']); $variables['caption_needed'] = TRUE; } $variables['responsive'] = FALSE; // If the table has headers and it should react responsively to columns hidden Loading