Problem/Motivation
We have a page containing a search_api view and an SQL view.
VBO checkboxes and button are not displayed correctly on the SQL view.
This happens because ViewsBulkOperationsViewData::getEntityTypeIds() returns NULL for this view so ViewsBulkOperationsBulkForm::init() does not add any action.
The root cause seems to be that ViewsBulkOperationsViewData::$data is shared between each view, which causes all sorts of troubles. For example, ViewsBulkOperationsViewData::getViewProvider() returns search_api for both views (instead of search_api and media respectively).
Steps to reproduce
- Display a search_api view and a media SQL view on the same page.
- Inspect the result of
ViewsBulkOperationsViewData::getViewProvider()for each view. - It is the same for both views.
Proposed resolution
Not caching $this->data in ViewsBulkOperationsViewData::getData(), but I am not sure it is the best solution.
Maybe it could be cached per-view?
Issue fork views_bulk_operations-3263678
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:
- 3263678-vbo-not-initialized
changes, plain diff MR !24
Comments
Comment #3
graber commentedComment #4
graber commentedComment #5
graber commentedComment #6
graber commentedNew MR to 4.1.x needed.
Comment #8
graber commentedComment #10
r_h-l commentedThe commit for this issue (4c2cb08b) breaks functionality.
src/Service/ViewsBulkOperationsViewData.php:117 `$table_data = $viewsData->get($relationship['table']);`
Calls $viewsData, which is not defined at that point. it is defined later, in a different if statement, on line 125. This is causing functionality to break in some circumstances
Comment #11
graber commentedGood spot @R_H-L, pushed a fix to dev. Thank you!
Comment #12
graber commented