Questions tagged as ['actions']

A specially written PHP callback whose parameters are configured through the web is, in Drupal terminology, an action.
Score: 0
view and context variables does not get passed on VBO custom execute action
in flag

I have created a custom VBO action and below is my code for the customaction.php. The action is getting created perfectly fine, however the $view and $context variables are not getting passed through. They are all getting null. Below is the custom action code:

    namespace Drupal\mymod\Plugin\Action;
    
    use Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase;
    
    /**
      ...
Score: 0
Overwrite a specific VBO action processed message
in flag

I am using VBO to perform bulk operations on my view. I have 2 core VBO actions and 2 custom actions.

  • Publish comment
  • Unpublish comment
  • Publish resource
  • Unpublish resource

When the Apply action button is clicked with none of the grid row is selected, I get this error message.

Select one or more comments to perform the update on.

I would like to rewrite this error message as An attachment has to  ...

Score: 0
yuuuu avatar
Delaying a Rules action until previous actions are complete
ao flag

I'm making an HTTP request in an action which obviously takes some time. I want to use the response of that request in another action, but every time I get an error since the request hasn't completed yet so the response variable is empty.

Specifically, I will save the json response from the first action and then pass it to a feed.

I'm using Drupal 8.

I've tried searching every form of words I can imagi ...

Score: 0
ilechcod avatar
How do I convert an action button to drop button?
in flag

I have my action buttons defined in my links.action.yml file and they show on the appropriate routes. But there's a page that requires 2 action buttons - Add Certification and Add license Since both buttons add something, it makes perfect sense to to have both on a dropbutton (like the operations button that shows on entity collection views). This is much better than having 2 separate action buttons side ...

Score: -2
How to add an external link inside form actions?
ca flag

I want to programmatically add an external link next to my submit button in a form that I have created.

Score: -2
Jiah avatar
Form submission field not available in form action
in flag

I have the following form submission handler.

function mymod_form_submit(&$form, FormStateInterface $form_state) {
  $ka_selected = $form_state->getValue('ka_types');
  \Drupal::state()->set('ka_types', $ka_selected);
  return $ka_selected;
}

It returns the ka_types field value. I want to use $ka_selected in custom action code.

public function execute(ContentEntityInterface $entity = NULL ...
Score: 0
Jiah avatar
Pass the view rows into a custom VBO action
in flag

I have a view with set of results. I want to pass the view rows into custom VBO action. I saw the below links that already implements this "pass_view" functionality in VBO.

https://www.drupal.org/project/views_bulk_operations/issues/1180538 --> Drupal 7

https://www.drupal.org/node/2884847 --> Drupal 8

This feature is not implemented in the recent VBO version. I am using Drupal 9.

Any help on h ...

Score: 0
Jiah avatar
Plugin not found/invalid plugin error while creating VBO custom action
in flag

I am creating VBO custom action and I constantly see the below error:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "publish_TR_action" plugin does not exist. Valid plugin IDs for Drupal\Core\Action\ActionManager are: node_export_action, comment_unpublish_by_keyword_action, entity_delete_action:comment, node_assign_owner_action, node_unpromote_action, node_promote_action, node_make ...