Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
System actions aren't exposed in the VBO field. This is because VBO is looking for an empty "type" attribute when in core the "type" attribute is populated with "system".
Example, in Drupal\Core\Action\Plugin\Action\EmailAction which should have shown up as a "Send email" action does not appear as a usable operation:
/**
* Sends an email message.
*
* @Action(
* id = "action_send_email_action",
* label = @Translation("Send email"),
* type = "system"
* )
*/
class EmailAction [...]
Comment | File | Size | Author |
---|---|---|---|
#2 | 3183064-system-actions.patch | 1.68 KB | djdevin |
|
Comments
Comment #2
djdevinComment #3
Graber CreditAttribution: Graber as a volunteer commentedIt's sad that core is changing its API and making it harder for VBO to be compatible. We can't go for a general solution like this, because we don't know on what entity types we can execute those actions. We currently mark some system actions as incompatible with VBO (those that use a confirmation step hack - saving list to tempstore in execute() method), but that list changed since it was created and is not applicable now.
I think we should go for a different solution instead and blacklist all core actions except a list that'll actually work with VBO.
Comment #4
Graber CreditAttribution: Graber as a volunteer commentedOk, I put more time into this and system actions shouldn't be available in VBO as they don't do anything on entities and VBO is for performing actions on entities.
BTW, see
Drupal\Core\Action\Plugin\Action\EmailAction::execute()
- it actually looks like it's supposed to use nodes only.Comment #5
djdevinOkay, that makes sense.
There doesn't seem to be an email action that can be used generically. Views Send is in its own little world.
If we were to make a VBO action for sending an email to an arbitrary entity using tokens, could it live in the VBO project?
Comment #6
liquidcms CreditAttribution: liquidcms commentedI was hoping to be able to get the "Update URL Alias" action with VBO; but it is only available with the core bulk actions handler. Tried this patch - didn't help.
This wasn't like this in D7, was it? That there were 2 different types of actions: VBO actions and Core actions.
Would it not be possible to add a wrapper action in VBO that pulled in each of the core actions?
Comment #7
Graber CreditAttribution: Graber as a volunteer commentedVBO uses core actions as well, it's just some are not compatible as they implement a confirmation / configuration step in a weird way (each action saves results to tempstore in it's execute method instead of actually executing there which is a workaround for a lack of API that VBO has really).
Please see
ViewsBulkOperationsActionManager::findDefinitions()
and my long comment on that.Comment #8
liquidcms CreditAttribution: liquidcms commented@Graber, thanks for the clarification.
Comment #9
bmenk CreditAttribution: bmenk commentedI"m not 100% sure I understand this technically, but would this issue be the causing the failure of using VBO to publish a selection of nodes via drush? Publish nodes is in the Core actions list and VBO now tells me that it has no "node_publish_action" available to it.
(I added my D9, drush10, VBO issues with this to an earlier thread at https://www.drupal.org/project/views_bulk_operations/issues/3207450 but perhaps that was the wrong place to put the question).
Thanks.
Bobb Menk
Comment #10
Graber CreditAttribution: Graber as a volunteer commentedPlease upgrade to 4.1.0 if possible and run
drush vbo-list
.