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 [...]
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djdevin created an issue. See original summary.

djdevin’s picture

Graber’s picture

Status: Needs review » Needs work

It'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.

Graber’s picture

Status: Needs work » Postponed (maintainer needs more info)

Ok, 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.

djdevin’s picture

Okay, 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?

liquidcms’s picture

I 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?

Graber’s picture

VBO 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.

liquidcms’s picture

@Graber, thanks for the clarification.

bmenk’s picture

I"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

Graber’s picture

Please upgrade to 4.1.0 if possible and run drush vbo-list.