Problem/Motivation
Something in between 4.2.5 and 4.2.6 is causing the checkboxes in my `commerce_product_variation` view to go missing. There is no ability to select each row, but there are options at the bottom of the view to select all rows. Reverting to 4.2.5 fixes the issue.
I'm investigating which commit causes the issue for me and to confirm it it's not a project specific bug, but wanted to get the issue open in case others are experiencing this.
Steps to reproduce
Create a view with VBO view (mine was commerce_product_variation)
Get checkboxes...
Add a Views Data Export display and attach it to the VBO parent view in the "Path settings" for the export display
No checkboxes...
Issue fork views_bulk_operations-3422715
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 #2
andyg5000The issue appears after applying the commit form #3106177: Create API for view provider modules to provide entity labels and bulk form keys
Comment #3
andyg5000In my instance
$this->view->resultin https://git.drupalcode.org/project/views_bulk_operations/-/blob/4.2.x/sr... is null unless I add$this->view->execute();right before it.Not sure if that's the best solution, but will work up a patch once I have something to share.
Comment #4
andyg5000It looks like attaching a Views Data Export display to the same view as the VBO is causing this. Not sure which module should be responsible for fixing it, but it seems like it's probably VBO's responsibility. Here's what's happening:
Somewhere between `ViewsBulkOperationsBulkForm` and `ViewsBulkOperationsViewData` the object expected as
$this->viewis losing it's reference to being the same object.ViewsBulkOperationsBulkForm calls :
And in `ViewsBulkOperationsViewData`, the
$this->view->resultis null event though checked !empty aboveIf I remove the data export as an attachment to the VBO view, the issue goes away.
Comment #5
andyg5000Comment #6
andyg5000I was able to fix this by aborting the init when the view display is a data export. It seems like you wouldn't ever have VBO as part of a data export anyway. I'm not sure this is the best approach, but it does fix this issue and I can still export the data.
If you didn't want to go this route, I believe you will need to split
$this->viewDatainto an array of views data instances based on the view display. Or maybe even not use the service container for that since it's the same object that's reused across multiple views displays being loaded in a single request.Comment #8
graber commentedUnfortunately we cannot accommodate every module that breaks VBO like this, we need a generic solution if it exists.
Setting this to “needs work” for now, maybe the diff will be useful for someone that needs this fixed urgently.
Thanks!
Comment #9
vmarchukI can also confirm that this issue appears in 4.2.6, but I don't see it in 4.2.5.
The fix from MR fixes this, not sure if this fix is "good" but can be used as a temporary solution.
Comment #10
sadikyalcin commentedRemoving the VBO field from the data export view fixes the issue.
Comment #11
graber commentedMaybe you can consider using https://www.drupal.org/project/vbo_export on the view instead?
Comment #12
vaish commentedI run into this issue after the upgrade to 4.2.6. Solution suggested in comment #10 worked for me. VBO field doesn't serve any purpose in the "data export" display.
Comment #13
vmarchukI can also confirm that the solution suggested in comment #10 helped solve this problem!