Action plugins not available in views bulk actions

Created on 28 September 2017, about 7 years ago
Updated 26 August 2024, 4 months ago

Problem/Motivation

Views bulk actions load entities directly instead of using the plugin manager.

The core action is a plugin with a manager. It also has an internal way of handling the different "types" of plugins.
See \Drupal\Core\Action\ActionManager

However when views generates the bulk action form it relies on the loading of the action config entities directly, causing plugins that are derived/defined in code not to be displayed.

See \views_views_data() the stanza below // Registers an action bulk form per entity.

Steps to reproduce

  1. Install Drupal with standard profile
  2. Create at least one node
  3. Add a new Action plugin class to the standard namespace (with type "node"). Example action plugin attached
  4. Flush the caches
  5. Review the available bulk actions on /admin/content

Expected: The new action is visible in the dropdown
Actual: It's not visible (since it doesn't have an underlying config entity)

Proposed resolution

Use the manager plugin instead of the loading of the action entities directly.

The forced adding of extra config entities has the potential to generate a lot of bloated extra code to provide a very simple functionality. Compared to the deriver logic. An example can be found here: https://www.drupal.org/node/2912390

Remaining tasks

Make existing config entity implementations compatible with this logic.

Test coverage.

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Views 

Last updated about 2 hours ago

Created by

🇧🇪Belgium suranga.gamage

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024