- Issue created by @andyg5000
- πΊπΈUnited States andyg5000 North Carolina, USA
The issue appears after applying the commit form π Create API for view provider modules to provide entity labels and bulk form keys Fixed
- πΊπΈUnited States andyg5000 North Carolina, USA
In my instance
$this->view->result
in 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.
- πΊπΈUnited States andyg5000 North Carolina, USA
It 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->view
is losing it's reference to being the same object.ViewsBulkOperationsBulkForm calls :
<?php $action_options = $this->getBulkOptions(); if (!empty($this->view->result) && !empty($action_options)) { // Get bulk form keys and entity labels for all rows. $entity_data = $this->viewData->getViewEntityData(); ...
And in `ViewsBulkOperationsViewData`, the
$this->view->result
is null event though checked !empty above$base_field = $this->view->storage->get('base_field'); foreach ($this->view->result as $row_index => $row) {
If I remove the data export as an attachment to the VBO view, the issue goes away.
- Status changed to Needs review
9 months ago 7:05pm 20 February 2024 - πΊπΈUnited States andyg5000 North Carolina, USA
I 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->viewData
into 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. - Merge request !79Issue #3422715: Missing checkboxes in 4.2.6 when using Views Data Export β (Open) created by andyg5000
- last update
9 months ago 15 pass - Status changed to Needs work
9 months ago 7:19am 21 February 2024 - π΅π±Poland Graber
Unfortunately 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!
- πΊπ¦Ukraine marchuk.vitaliy Rivne, UA
I 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. - π¬π§United Kingdom sadikyalcin
Removing the VBO field from the data export view fixes the issue.
- π΅π±Poland Graber
Maybe you can consider using https://www.drupal.org/project/vbo_export β on the view instead?
- π·πΈSerbia vaish
I 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.