- Issue created by @altcom_alfonso
- Merge request !12Added checks before modifying the action definitions. → (Open) created by Unnamed author
- 🇬🇧United Kingdom altcom_neil
This is still an issue when using Drupal 10.5.1, Views Bulk Operations 4.3.4, and Administer Users by Role 3.5.0
Just expanding on what is going on here.
Content Moderation does this:
function content_moderation_action_info_alter(&$definitions) { // The publish/unpublish actions are not valid on moderated entities. So swap // their implementations out for alternates that will become a no-op on a // moderated entity. If another module has already swapped out those classes, // though, we'll be polite and do nothing. foreach ($definitions as &$definition) { if ($definition['id'] === 'entity:publish_action' && $definition['class'] == PublishAction::class) { $definition['class'] = ModerationOptOutPublish::class; } if ($definition['id'] === 'entity:unpublish_action' && $definition['class'] == UnpublishAction::class) { $definition['class'] = ModerationOptOutUnpublish::class; } } }
it is not expecting the array to be missing the id - which I guess it shouldn't be.
The code in Views Bulk Operations removing the action definitions is in the Actions Permissions sub module - https://git.drupalcode.org/project/views_bulk_operations/-/blob/4.3.x/mo...
Because this code runs before the administerusersbyrole_action_info_alter(), the definitions are removed before this module tries to change the class.