From 242ac392d827a47c8ca475ce62d2d24d8c54303c Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Tue, 8 Apr 2014 14:11:00 -0700
Subject: [PATCH] Issue #2226923 by pakmanlh, mandar.harkare, mortendk,
 galooph: Views: remove wrapper around more link - add class to the link.

---
 core/modules/system/css/system.theme.css                  | 1 +
 .../views/lib/Drupal/views/Tests/Plugin/DisplayTest.php   | 8 ++++----
 core/modules/views/templates/views-more.html.twig         | 6 +-----
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/core/modules/system/css/system.theme.css b/core/modules/system/css/system.theme.css
index f397a5a640b4..01ee3d182879 100644
--- a/core/modules/system/css/system.theme.css
+++ b/core/modules/system/css/system.theme.css
@@ -124,6 +124,7 @@ abbr.form-required, abbr.tabledrag-changed, abbr.ajax-changed {
  * Markup generated by theme_more_link().
  */
 .more-link {
+  display: block;
   text-align: right; /* LTR */
 }
 [dir="rtl"] .more-link {
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
index 5a284d8f15b5..a99bfcdb6966 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
@@ -182,7 +182,7 @@ public function testReadMore() {
     $output = drupal_render($output);
 
     $this->drupalSetContent($output);
-    $result = $this->xpath('//div[@class=:class]/a', array(':class' => 'more-link'));
+    $result = $this->xpath('//a[@class=:class]', array(':class' => 'more-link'));
     $this->assertEqual($result[0]->attributes()->href, url('test_display_more'), 'The right more link is shown.');
     $this->assertEqual(trim($result[0][0]), $expected_more_text, 'The right link text is shown.');
 
@@ -191,7 +191,7 @@ public function testReadMore() {
     $more_link = $view->display_handler->renderMoreLink();
     $more_link = drupal_render($more_link);
     $this->drupalSetContent($more_link);
-    $result = $this->xpath('//div[@class=:class]/a', array(':class' => 'more-link'));
+    $result = $this->xpath('//a[@class=:class]', array(':class' => 'more-link'));
     $this->assertEqual($result[0]->attributes()->href, url('test_display_more'), 'The right more link is shown.');
     $this->assertEqual(trim($result[0][0]), $expected_more_text, 'The right link text is shown.');
 
@@ -207,7 +207,7 @@ public function testReadMore() {
     $output = $view->preview();
     $output = drupal_render($output);
     $this->drupalSetContent($output);
-    $result = $this->xpath('//div[@class=:class]/a', array(':class' => 'more-link'));
+    $result = $this->xpath('//a[@class=:class]', array(':class' => 'more-link'));
     $this->assertTrue(empty($result), 'The more link is not shown.');
 
     $view = Views::getView('test_display_more');
@@ -225,7 +225,7 @@ public function testReadMore() {
     $output = $view->preview();
     $output = drupal_render($output);
     $this->drupalSetContent($output);
-    $result = $this->xpath('//div[@class=:class]/a', array(':class' => 'more-link'));
+    $result = $this->xpath('//a[@class=:class]', array(':class' => 'more-link'));
     $this->assertTrue(empty($result), 'The more link is not shown when view has more records.');
 
     // Test the default value of use_more_always.
diff --git a/core/modules/views/templates/views-more.html.twig b/core/modules/views/templates/views-more.html.twig
index c92b8495d046..b161a65ddcba 100644
--- a/core/modules/views/templates/views-more.html.twig
+++ b/core/modules/views/templates/views-more.html.twig
@@ -11,8 +11,4 @@
  * @ingroup themeable
  */
 #}
-<div class="more-link">
-  <a href="{{ more_url }}">
-    {{ link_text }}
-  </a>
-</div>
+<a href="{{ more_url }}" class="more-link">{{ link_text }}</a>
-- 
GitLab