Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of meta-issue #1856630: [Change notice] [META] Rename Views methods to core standards
Comment | File | Size | Author |
---|---|---|---|
#15 | 2003276-15.patch | 5.93 KB | jibran |
#10 | views_rename_setOffset-2003276-10.patch | 6.23 KB | markie |
#7 | views_rename_setOffset-2003276-7.patch | 6.23 KB | markie |
#5 | views_rename_setOffset-2003276-5.patch | 6.23 KB | markie |
#2 | rename_setOffset-2003276-2.patch | 5.91 KB | markie |
Comments
Comment #1
markie CreditAttribution: markie commentedmultiple files affected
Comment #2
markie CreditAttribution: markie commented8 files affected by patch
Comment #3
oenie CreditAttribution: oenie commentedAdd public access modifier in front of the functions to adhere to the new OOP standards.
You've also missed some occurrences of the function (be sure to replace them in messages as well !):
core/modules/views/lib/Drupal/views/Plugin/views/pager/PagerPluginBase.php, line 90:
function get_offset() {
core/modules/views/lib/Drupal/views/Plugin/views/pager/SqlBase.php, line 364:
'#default_value' => $this->get_offset(),
core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php, line 282:
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure get_offset uses the settings of setOffset.');
core/modules/views/lib/Drupal/views/Tests/Plugin/PagerTest.php, line 308:
$this->assertEqual($view->getOffset(), $rand_number, 'Make sure get_offset uses the settings of setOffset.');
core/modules/views/lib/Drupal/views/ViewExecutable.php, line 503:
return $this->pager->get_offset();
Comment #4
oenie CreditAttribution: oenie commentedComment #5
markie CreditAttribution: markie commentedmissed items replaced. Public access added to functions.
Something to note, that I feel is outside of the scope of this task, is in the Counter class (Drupal\views\Plugin\views\field\Counter), line 53 has:
$count += ($pager->get_items_per_page() * $pager->get_current_page() + $pager->setOffset());
Shouldn't this actually be
$count += ($pager->get_items_per_page() * $pager->get_current_page() + $pager->getOffset());
?
(see line 9 of the patch)
Comment #7
markie CreditAttribution: markie commentedrerolled..
question from #5 still applies.
Comment #8
markie CreditAttribution: markie commentedreset status for patch testing goodness.
Comment #10
markie CreditAttribution: markie commentedrerolled
Comment #12
markie CreditAttribution: markie commented#10: views_rename_setOffset-2003276-10.patch queued for re-testing.
Comment #13
oenie CreditAttribution: oenie commentedLooks good to me now !
Comment #14
alexpottNeeds a reroll
Comment #15
jibranreroll
Comment #16
aspilicious CreditAttribution: aspilicious commentedComment #17
alexpottCommitted 99c2b59 and pushed to 8.x. Thanks!