Problem/Motivation
When running VBOs, I have been getting this error message:
Error: Call to a member function getOffset() on null in Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor->getPageList() (line 203 of …/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessor.php).
This is the code starting at line 203:
if ($pager_offset = $this->view->pager->getOffset()) {
$offset += $pager_offset;
}
This code is the only use of $this->view->pager in this class.
I changed this code to be robust against a NULL: $this->view->pager?->getOffset()
When I did that, I ran into the issue in #3217544: View query not built. Adding the fix in that issue fixed the problem for me.
Proposed resolution
Do the fix referred-to above (merge request for this issue) and the fix in #3217544: View query not built.
Remaining tasks
Implement.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork views_bulk_operations-3555811
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
liam morlandThe merge request contains the protection against a null pager proposed in the issue summary.
Comment #4
erutan commentedThis is a simple fix and I've been using it after having some oddness with pagers in VBO with no issues.
Comment #6
graber commentedhttps://git.drupalcode.org/project/views_bulk_operations/-/jobs/8717411
Comment #7
liam morlandThis could mean the schema is wrong. It says it is non-nullable, but having it being null is exactly what was happening. I could add an ignore comment.
Comment #8
graber commentedYes, I think that’s fine. Let’s just point to core views file in a comment above.
Comment #9
liam morlandSorry, I don't know what file to refer to. I added the ignore statement.
Comment #10
graber commentedProbably ViewExecutable.php, that’s where the pager property is?
Comment #11
graber commentedI can update when merging I guess..
Comment #12
graber commentedSo the issue comes from Core wrong @var tag :|
https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/views...
Comment #14
liam morlandThanks. I have created a follow-up to fix the types: #3585443: Fix types in ViewExecutable.
Comment #16
graber commentedNot good. Sorry for not linking earlier
https://www.drupal.org/project/drupal/issues/3585410