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 e87134e6c870028fffe2cf92a52ba10da4159cef..11874fe17d8b4ef7eb81019c69511ff00475d02c 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 @@ -87,7 +87,7 @@ function set_items_per_page($items) { * Even pagers that don't actually page can skip items at the beginning, * so few pagers will need to override this method. */ - function get_offset() { + public function getOffset() { return isset($this->options['offset']) ? $this->options['offset'] : 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 645e3674bfb274d5332e65e30883ccb9489151d7..4a5d6181716bc282b1eed3e530121f91e8dc9ba8 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 @@ -361,7 +361,7 @@ function exposed_form_alter(&$form, &$form_state) { '#size' => 10, '#maxlength' => 10, '#title' => $this->options['expose']['offset_label'], - '#default_value' => $this->get_offset(), + '#default_value' => $this->getOffset(), ); } } 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 2114de9f9127073cba6c75c95266c17a4e4ca740..55f2f0cd78343167c69410c2384669912848d312 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php @@ -279,7 +279,7 @@ function testPagerApi() { $this->assertEqual($view->getOffset(), NULL, 'If the pager is not initialized and no manual override there is no offset.'); $rand_number = rand(1, 5); $view->setOffset($rand_number); - $this->assertEqual($view->getOffset(), $rand_number, 'Make sure get_offset uses the settings of set_offset.'); + $this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of set_offset.'); $this->assertEqual($view->getCurrentPage(), NULL, 'If the pager is not initialized and no manual override there is no current page.'); $rand_number = rand(1, 5); @@ -305,7 +305,7 @@ function testPagerApi() { $view->setOffset($rand_number); $rand_number = rand(6, 11); $view->pager->set_offset($rand_number); - $this->assertEqual($view->getOffset(), $rand_number, 'Make sure get_offset uses the settings of set_offset.'); + $this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of set_offset.'); $this->assertEqual($view->getCurrentPage(), 0, 'Per default the current page is 0.'); $rand_number = rand(1, 5); diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index 5d8039dd5d0569160849a4e6a09739c77b1f0a82..3190b793a9a0b8fa1a043570a24ae1454d3b7655 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -500,7 +500,7 @@ public function setItemsPerPage($items_per_page) { public function getOffset() { // If the pager is already initialized, pass it through to the pager. if (!empty($this->pager)) { - return $this->pager->get_offset(); + return $this->pager->getOffset(); } if (isset($this->offset)) {