MDL-68427 core: Correct previous/next page in paging bar
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 16 Apr 2020 06:32:56 +0000 (14:32 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 16 Apr 2020 06:40:01 +0000 (14:40 +0800)
lib/outputcomponents.php

index fa9a76f..746a2a7 100644 (file)
@@ -3092,7 +3092,7 @@ class paging_bar implements renderable, templatable {
 
         if ($this->page > 0) {
             $data->previous = [
-                'page' => $this->page - 1,
+                'page' => $this->page,
                 'url' => (new moodle_url($this->baseurl, [$this->pagevar => $this->page - 1]))->out(false)
             ];
         }
@@ -3138,7 +3138,7 @@ class paging_bar implements renderable, templatable {
 
         if ($this->page + 1 != $lastpage) {
             $data->next = [
-                'page' => $this->page + 1,
+                'page' => $this->page + 2,
                 'url' => (new moodle_url($this->baseurl, [$this->pagevar => $this->page + 1]))->out(false)
             ];
         }