When an action plugin implements ViewsBulkOperationsPreconfigurationInterface then Views UI breaks

Created on 5 August 2024, 4 months ago

Problem/Motivation

When there is at least one action available that implements Drupal\views_bulk_operations\Action\ViewsBulkOperationsPreconfigurationInterface then Views UI breaks.

In the logs following error will be found:

 Error: Call to a member function broken() on null in Drupal\views_ui\ViewEditForm->getFormBucket() (line 1129 of /Users/mxh/projects/drupal/web/core/modules/views_ui/src/ViewEditForm.php).

Steps to reproduce

  • Create a new Drupal installation using the Standard profile
  • Install views_bulk_operations and one module that contains an action that implements the interface, for example views_bulk_operations_example provides such action
  • Go to Views UI and configure the admin content view, located at /admin/structure/views/view/content/edit/page_1
  • Remove the Node operations bulk form, and instead add the Views Bulk Operations field plugin
  • Instead of being redirected to the VBO config form, you will see that nothing happens but an error message "Oops, something went wrong. Check your browser's developer console for more details.". You will also find the logged error listed above.

Proposed resolution

Not haven't found a solution, but at least I found the place where the bug is triggered:
https://git.drupalcode.org/project/views_bulk_operations/-/blob/4.2.x/sr...

At that place, the view is being initialized, especially including its handlers. Maybe it's too early to initialize the view at that point?
When commenting out the line for initializing the handlers, then the error does not show up. But it was probably added for some reason, so just removing that part would probably have unwanted side effects.

Remaining tasks

  • Identify what the problem is
  • Fix the bug

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.3

Component

Actions

Created by

🇩🇪Germany mxh Offenburg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mxh
  • 🇩🇪Germany mxh Offenburg

    I have set this to Major because it breaks the Views UI. Feel free to set a different priority if wrong.

Production build 0.71.5 2024