diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php index 48d4039..5b22452 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php @@ -114,7 +114,7 @@ public function getCurrentPage() { * If provided, the page number will be set to this. If NOT provided, * the page number will be set from the global page array. */ - function set_current_page($number = NULL) { + public function setCurrentPage($number = NULL) { if (!is_numeric($number) || $number < 0) { $number = 0; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php index 40acc54..2afaaf4 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php @@ -249,7 +249,7 @@ public function query() { * If provided, the page number will be set to this. If NOT provided, * the page number will be set from the global page array. */ - function set_current_page($number = NULL) { + public function setCurrentPage($number = NULL) { if (isset($number)) { $this->current_page = max(0, $number); return; @@ -314,7 +314,7 @@ public function updatePageInfo() { // See if the requested page was within range: if ($this->current_page >= $pager_total[$this->options['id']]) { // Pages are numbered from 0 so if there are 10 pages, the last page is 9. - $this->set_current_page($pager_total[$this->options['id']] - 1); + $this->setCurrentPage($pager_total[$this->options['id']] - 1); } // Put this number in to guarantee that we do not generate notices when the pager diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php index 2c40c65..766c842 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php @@ -311,7 +311,7 @@ function testPagerApi() { $rand_number = rand(1, 5); $view->setCurrentPage($rand_number); $rand_number = rand(6, 11); - $view->pager->set_current_page($rand_number); + $view->pager->setCurrentPage($rand_number); $this->assertEqual($view->getCurrentPage(), $rand_number, 'Make sure getCurrentPage uses the settings of set_current_page.'); // Set an invalid page and make sure the method takes care about it. diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index 589a817..566a766 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -450,7 +450,7 @@ public function setCurrentPage($page) { // If the pager is already initialized, pass it through to the pager. if (!empty($this->pager)) { - return $this->pager->set_current_page($page); + return $this->pager->setCurrentPage($page); } } @@ -730,7 +730,7 @@ public function initPager() { $this->pager = $this->display_handler->getPlugin('pager'); if ($this->pager->usePager()) { - $this->pager->set_current_page($this->current_page); + $this->pager->setCurrentPage($this->current_page); } // These overrides may have been set earlier via $view->set_*