diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php index e0d932c..d6769ab 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php @@ -50,7 +50,7 @@ public function get_value($values, $field = NULL) { $pager = $this->view->pager; // Get the base count of the pager. if ($pager->usePager()) { - $count += ($pager->get_items_per_page() * $pager->get_current_page() + $pager->set_offset()); + $count += ($pager->get_items_per_page() * $pager->get_current_page() + $pager->setOffset()); } // Add the counter for the current site. $count += $this->view->row_index + 1; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php index a71538d..0e2ecb9 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/None.php @@ -86,7 +86,7 @@ public function postExecute(&$result) { public function query() { // The only query modifications we might do are offsets. if (!empty($this->options['offset'])) { - $this->view->query->set_offset($this->options['offset']); + $this->view->query->setOffset($this->options['offset']); } } 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 cc932ee..84c859d 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 @@ -94,7 +94,7 @@ function get_offset() { /** * Set the page offset, or how many items to skip. */ - function set_offset($offset) { + public function setOffset($offset) { $this->options['offset'] = $offset; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/pager/Some.php b/core/modules/views/lib/Drupal/views/Plugin/views/pager/Some.php index 67d4b33..e424d73 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/pager/Some.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/pager/Some.php @@ -70,7 +70,7 @@ function use_count_query() { public function query() { $this->view->query->set_limit($this->options['items_per_page']); - $this->view->query->set_offset($this->options['offset']); + $this->view->query->setOffset($this->options['offset']); } } 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 03af37f..68510f1 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 @@ -238,7 +238,7 @@ public function query() { } $this->view->query->set_limit($limit); - $this->view->query->set_offset($offset); + $this->view->query->setOffset($offset); } @@ -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/Plugin/views/query/QueryPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php index 2d967cf..ff669bf 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/QueryPluginBase.php @@ -106,7 +106,7 @@ function set_limit($limit) { /** * Set an OFFSET on the query, specifying a number of results to skip */ - function set_offset($offset) { + public function setOffset($offset) { $this->offset = $offset; } 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 2114de9..1197ba8 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 setOffset.'); $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); @@ -304,8 +304,8 @@ function testPagerApi() { $rand_number = rand(1, 5); $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.'); + $view->pager->setOffset($rand_number); + $this->assertEqual($view->getOffset(), $rand_number, 'Make sure getOffset uses the settings of setOffset.'); $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 b4f76c2..e82e7f8 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -516,7 +516,7 @@ public function setOffset($offset) { // If the pager is already initialized, pass it through to the pager. if (!empty($this->pager)) { - $this->pager->set_offset($offset); + $this->pager->setOffset($offset); } } @@ -737,7 +737,7 @@ public function initPager() { } if (isset($this->offset)) { - $this->pager->set_offset($this->offset); + $this->pager->setOffset($this->offset); } } }