diff --git a/core/modules/views/src/Plugin/views/pager/Mini.php b/core/modules/views/src/Plugin/views/pager/Mini.php
index 640010d..4a3e81f 100644
--- a/core/modules/views/src/Plugin/views/pager/Mini.php
+++ b/core/modules/views/src/Plugin/views/pager/Mini.php
@@ -36,9 +36,20 @@ public function defineOptions() {
    */
   public function summaryTitle() {
     if (!empty($this->options['offset'])) {
-      return $this->formatPlural($this->options['items_per_page'], 'Mini pager, @count item, skip @skip', 'Mini pager, @count items, skip @skip', array('@count' => $this->options['items_per_page'], '@skip' => $this->options['offset']));
+      return $this->formatPlural($this->options['items_per_page'],
+        'Mini pager, @count item, skip @skip',
+        'Mini pager, @count items, skip @skip',
+        array(
+          '@count' => $this->options['items_per_page'],
+          '@skip' => $this->options['offset'])
+      );
     }
-      return $this->formatPlural($this->options['items_per_page'], 'Mini pager, @count item', 'Mini pager, @count items', array('@count' => $this->options['items_per_page']));
+    return $this->formatPlural($this->options['items_per_page'],
+      'Mini pager, @count item',
+      'Mini pager, @count items',
+      array(
+        '@count' => $this->options['items_per_page'])
+    );
   }
 
   /**
@@ -49,7 +60,8 @@ public function query() {
 
     // Don't query for the next page if we have a pager that has a limited
     // amount of pages.
-    if ($this->getItemsPerPage() > 0 && (empty($this->options['total_pages']) || ($this->getCurrentPage() < $this->options['total_pages']))) {
+    if ($this->getItemsPerPage() > 0 &&
+      (empty($this->options['total_pages']) || ($this->getCurrentPage() < $this->options['total_pages']))) {
       // Increase the items in the query in order to be able to find out whether
       // there is another page.
       $limit = $this->view->query->getLimit();
@@ -72,11 +84,16 @@ public function postExecute(&$result) {
     // In query() one more item might have been retrieved than necessary. If so,
     // the next link needs to be displayed and the item removed.
     if ($this->getItemsPerPage() > 0 && count($result) > $this->getItemsPerPage()) {
-      array_pop($result);
-      // Make sure the pager shows the next link by setting the total items to
-      // the biggest possible number but prevent failing calculations like
-      // ceil(PHP_INT_MAX) we take PHP_INT_MAX / 2.
-      $total = PHP_INT_MAX / 2;
+      if ($this->view->footer) {
+        $total = $this->view->pager->total_items;
+      }
+      else {
+        array_pop($result);
+        // Make sure the pager shows the next link by setting the total items to
+        // the biggest possible number but prevent failing calculations like
+        // ceil(PHP_INT_MAX) we take PHP_INT_MAX / 2.
+        $total = PHP_INT_MAX / 2;
+      }
     }
     else {
       $total = $this->getCurrentPage() * $this->getItemsPerPage() + count($result);
