Closed (fixed)
Project:
Views Bulk Operations (VBO)
Version:
4.4.x-dev
Component:
Core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jan 2026 at 10:43 UTC
Updated:
16 Mar 2026 at 11:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dkmishra commentedComment #3
dkmishra commentedComment #4
dkmishra commentedComment #7
albert.garcia commentedAssuming the array key should be set somewhere or is unset somewhere where it should not... Checking for the array key should get rid of the warning while this is investigated. Attaching a patch which matches the MR I submitted.
Comment #8
dkmishra commentedThis patch fixes a bug with exclude_mode in the Views Bulk Operations bulk form.
The issue occurred in two places: line 721 and line 803 of
ViewsBulkOperationsBulkForm.php. Both locations are corrected in this patch.
Tested locally:
- Created a VBO view with multiple content items
- Enabled exclude mode and selected/deselected items
- Checked that the selection state is correctly inverted
- Bulk operations worked as expected
Comment #9
thulenb commentedI am getting the same error.
I show 20 items on the view and get the error on line 721 20 times plus error on line 803 one time.
I double-checked if the patch is correctly applied.
I also have version 4.4.4
Does somebody have a hint what else I could do?
Comment #10
joelpittet@devendra mishra the patch looks pretty good, could you roll those into a new MR or on top of !136? Or @albert.garcia, maybe you could?
@grabber might knows why we are unset()ing the 'exclude_mode' key here which might be part of the problem:
https://git.drupal.org/project/views_bulk_operations/-/blob/f301718ef562...
Introduces a (maybe on purpose) a tri-state for this key.
Setting this version to the dev branch, thanks for reporting this issue. I am able to confirm this patch fixes the issue and it's quite reproducible.
@graber happy to add tests if you want, though this might not warrant any.
Comment #13
dkmishra commentedThanks for the feedback, @joelpittet!
I’ve created a new MR with the changes. Please have a look when you get a chance.
Comment #14
joelpittetGreat, thank you @devendra mishra!
I will assign this to @graber to have a peek at my question in #10
Comment #15
graber commentedI think we should add default values to the tempstore array in the set tempstore so everything ever required is set (and currently exclude_mode is added there on initialization). exclude_mode key should be a boolean in all cases so we should drop all unset() and set it to FALSE in those places. We could then drop all NULL checks.
I'll handle this.
Comment #16
graber commentedComment #18
graber commentedPlease test someone, hope I haven't missed anything. This makes sure exclude_mode tempstore key is always a boolean and explicitly set to FALSE if there's nothing to exclude.
Comment #19
graber commented@joel, Re tests.. now we should get warnings if exclude_mode is not set. We could add a watchdog test as in Drupal LMS tests (TBH, such a method should be in Core as that's not checked in functional and JS tests by default and should be).
Comment #20
joelpittetThat looks more elaborate but does the change I was hoping for, so +1 from me. I'll let @devendra mishra test and RTBC to ensure it's doing what deven needs.
That LMS test is interesting, but I wonder if each test method running it's own instance of drupal built from scratch, the logs might not be super accurate at finding things. Though it would be nice if those PHP notices errored all the time in PHPunit if they don't already...
Comment #21
graber commentedRe the tests: the problem with functional js ones is that the notices / warnings happen on a different level - in the app and not in the test runner. If any of those happen in the runner as in the case of kernel tests - it’s reported. Not 100% sure about functional (no js) tests though. Worth checking.
Comment #22
erutan commentedI was getting this error itermittently, after applying the patch I haven't seen it.
It also fixes an OOM error when trying to load a view that I was passing args to via the url. :)
I'd mark it as RBTC aside from the issues testing it.
Comment #24
erutan commentedThis has been committed. Should it still be Needs Review?
Comment #25
graber commentedMust've missed it, thanks.