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

  1. Display a search_api view and a media SQL view on the same page.
  2. Inspect the result of ViewsBulkOperationsViewData::getViewProvider() for each view.
  3. 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?

Command icon 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

prudloff created an issue. See original summary.

graber’s picture

Status: Active » Needs review
graber’s picture

Status: Needs review » Needs work
graber’s picture

Version: 4.0.0 » 4.1.x-dev
graber’s picture

New MR to 4.1.x needed.

  • Graber committed 4c2cb08 on 4.1.x
    Issue #3263678 by prudloff: VBO not initialized correctly when a page...
graber’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

r_h-l’s picture

The 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

graber’s picture

Good spot @R_H-L, pushed a fix to dev. Thank you!

graber’s picture