Questions tagged [actions]
A specially written PHP callback whose parameters are configured through the web is, in Drupal terminology, an action.
134 questions
0
votes
1
answer
476
views
Make a custom action with form
I am trying to make a custom user action where the selected users will have a node created manually, however I need to create a form to save the data that this node will have, such as: title, start ...
1
vote
1
answer
104
views
Button that enrolls students for a course and leads to the enrollment form
I have an actions.yml file with the following content.
student_enrollment.enroll_course:
route_name: student_enrollment.enroll
route_parameters:
course_id: 1
title: Enroll
...
0
votes
0
answers
135
views
Bulk update product variations weight
I've created a module for a custom VBO action.
The action can be selected in the view, and the function is executed, but $request is empty and the selected product variation IDs are not available.
...
2
votes
1
answer
212
views
Display local actions only on nodes of given type
I have defined a local action in my_module.links.action.yml.
I have defined, that it should be displayed on a single route appears_on: entity.node.canonical. - And it works fine.
Now I try to achieve, ...
2
votes
1
answer
616
views
I can't see custom action
I am trying to create a custom action for bulk operations on commerce orders.
I am using the following code.
mymodule/src/Plugin/Action/DeleteOrderAndApps.php
namespace Drupal\mymodule\Plugin\Action;
...
0
votes
1
answer
30
views
Add a second RulesAction to a custom module
I created a custom module containing one Rules Action that works perfectly. I tried adding a second by creating a second php file in the MODULE/src/Plugin/RulesAction folder, with the names and class ...
0
votes
1
answer
220
views
Overwrite a specific VBO action processed message
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 ...
0
votes
0
answers
24
views
Delaying a Rules action until previous actions are complete
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 ...
-2
votes
1
answer
559
views
How to add an external link inside form actions?
I want to programmatically add an external link next to my submit button in a form that I have created.
-2
votes
1
answer
51
views
Form submission field not available in form action
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(...
0
votes
0
answers
122
views
Pass the view rows into a custom VBO action
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....
1
vote
0
answers
69
views
Plugin not found/invalid plugin error while creating VBO custom action
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 ...
4
votes
1
answer
2k
views
Add a custom action on admin content page
I want to add a custom action to the dropdown on the admin content page (/admin/content) as shown in the screenshot below using Drupal 9. The views module is enabled so that form is part of the view.
...
1
vote
1
answer
56
views
Memory error when updating user field with Rules
I'm using the Rules module to update my user email signatures.
The rule get's triggered whenever an account is updated and performs a simple custom action.
This is the action, all it does is save a ...
0
votes
0
answers
38
views
How to execute migration on selected nodes thru core bulk action plugin?
I'm trying to execute migration to create a copy of selected content nodes to other content type. Migration source (plugin: content_entity) is content_type_a and destination (plugin: entity) is ...
0
votes
1
answer
138
views
Change workbench moderation state with VBO does not work properly
I have two workbench moderation states draft and publihsed
When I try to change the state of a node from draft to published using VBO's set moderation state action, It actually republish the published ...
3
votes
1
answer
1k
views
custom action plugin with ConfigurationForm
I am trying to create a custom action with Configuration Form Field . I am able to create Action and it is being displayed on content page ( /admin/content ) , but I am not able to find the path to ...
-1
votes
1
answer
167
views
Taxonomy Term Field of a Reference Field in a Product not available in Data Selector for CheckOut Rules
I installed Drupal Commerce Kickstart 2 with drupal version 7.54 and drupal commerce Version: 7.x-1.14. My problem is I want to send email to the store owner every time an order is completed. So in ...
0
votes
1
answer
82
views
module to test if e-mail is working
In D7 I'm trying to determine the best way to periodically check if e-mail is working. I'm looking for a way to create a workflow that, say, on cron would check the day of the month, if it's the day ...
1
vote
1
answer
1k
views
How to get the selected items (with VBO) in the buildConfigurationForm of a custom Action
I have made a custom action which have a configuration form:
class MyAction extends ConfigurableActionBase
Thus, I have the opportunity to create a form that allows the user to set some options. ...
3
votes
1
answer
691
views
How can I trigger a Drupal Core action without writing any PHP code?
On my D8 site I have configured an action of type "Send email" using the Drupal Core "Actions" module (module can be installed under "Administration > Extend"). I want this Drupal Core action to ...
3
votes
1
answer
761
views
Execute actions (actions module not rules module) programatically
How can an action from the actions module be executed programatically? In D7 there was actions_do() but in D8 actions are plugins or configuration entities according to https://www.drupal.org/node/...
2
votes
1
answer
162
views
View field with link to excecute action plugin
How can one add a field in views with a link to a custom Action plugin?
With bulk operations it's possible to create a checkbox to perform an action to a set of results. My actions have an access ...
1
vote
1
answer
494
views
How do I create a custom action?
I want to create simple actions that will change the field_support_status field value to 1 or 0. I enabled the "Actions" module and created a custom module with my actions, but after the module is ...
0
votes
1
answer
95
views
Actions module - redirect to url
I'm trying to learn about the functionality of this module, however I don't understand quite right what the Redirect to URL option means/does. Any hint in the right direction will be much appreciated.
3
votes
1
answer
101
views
How to troubleshoot my VBO operation which freezes at 50% every time?
I have written custom code that creates a new action for Views Bulk Operations (VBO). I am trying to run the action and it gets stuck at "Prepared 46748 out of 46766". If I run the same action with ...
2
votes
2
answers
2k
views
Trigger an action programmatically
I have defined an action and want to trigger it from a hook.
We do not want to use the Rules module, because it is still buggy with Drupal 8. So, we cannot use rules_invoke_component().
What is the ...
0
votes
0
answers
130
views
How to use tokens with actions module?
I'm trying to use core Actions module to send email after new comment has been inserted. I'm doing it with Action::load('<my_mail_action>')->execute([$entity]); executed with function ...
1
vote
0
answers
169
views
How to set an action to unpublish content containing some particular keywords?
I just enabled action module provided by Drupal core. There in configuration, I have chosen CREATE AN ADVANCED ACTION, and then choose "unpublish content containing keywords". I have entered keywords ...
1
vote
1
answer
520
views
How do I code to take action when a VBO (bulk action) is finished?
I've recently coded a few Drupal\x\Plugin\Action classes that respond nicely to my VBO (now bulk actions?) in Drupal 8. Now I'd like to implement a hook, or whatever is required, to take action when ...
2
votes
3
answers
3k
views
Operations bulk form for custom content entity
There is a custom entity called organisation. I am trying to build a view to allow bulk delete of the entities.
I checked the view for display content and there is a field to display the checkbox(...
1
vote
1
answer
49
views
"Unable to send email" error shown to anonymous users in Workflow action
Using the Workflow module, I've got a content type that can be created by anonymous and authenticated users alike, then it goes into a review process. Upon creation, I want to email the user with a ...
0
votes
0
answers
294
views
how to change node submit form text for all users?
I created the node type 'application',which can be added by any users and will be unpublished by default.
I used hook_form_id_alter() to change the text of the submit button as below:
function ...
0
votes
2
answers
27
views
Using triggers to add new user to a mailing list
I would like the Mailman Integration module to add any new user to a mailing list. I enabled Triggers and created an action in PHP. I then assigned the action to execute when a new user is created. I ...
1
vote
1
answer
555
views
Unable to change the author of content using views/action
I want to change the author of multiple nodes. I have set up a new action by going to /admin/config/system/actions and then selecting "CREATE AN ADVANCED ACTION" and then "Change the author of content....
1
vote
2
answers
598
views
How can I produce a non-blocking process to modify newly created nodes of custom content type?
I have a custom content type called a Scan where the only required field is ISBN. Nodes of this type are created when a user POSTs to my REST API endpoint with an ISBN number. That's all working fine, ...
5
votes
1
answer
5k
views
How to create custom rules action event conditions?
Is there any universal formula or module to create custom rules actions, events and conditions? So that I just have to replace the required values and rest of the code remains the same. I searched, ...
0
votes
1
answer
137
views
VBO action on pending node revision (using Revisioning) publishes the revision
I have a View listing pending node revisions (using Revisioning). I have several actions, like changing the node author, which are executed using Views Bulk Operations. Executing, for example, the "...
0
votes
2
answers
39
views
Rules does not have any action for publish selected content
In admin/content page we have some update options. I want to execute a Php code only when I use publish selected content or unpublished selected content on that page.
This rules should be fired JUST ...
1
vote
1
answer
2k
views
How to use tokens in data selectors in Rules and how to get autocomplete to work?
In Drupal 7, the Rules module was quite simple to use. You create a rule, define it's action and done. In Drupal 8 version of Rules however, i.e the alfa1 version (which is what I'm using), I see some ...
1
vote
2
answers
140
views
VBO calls entity_save after custom action is triggered. How to stop that?
I have VBO custom actions defined and it gets triggered. Also, I do NOT have 'behavior' => array('changes_property') defined in my hook_actions_info() as described in How to create custom VBO action?
...
0
votes
1
answer
73
views
Rules event is not triggering
I've created a custom action to fire when the "checkout is complete" event occurs. The front end is a mobile application, where as the back end is Drupal. So I create an order using its API and update ...
0
votes
2
answers
3k
views
Different ways of logging in a user without having them to type anything?
I'm on Drupal 8 and currently looking to replicate similar functionality like: https://www.drupal.org/project/urllogin -- They do not have a D8 version yet.
I need to auto login a specific user ...
1
vote
1
answer
321
views
How to create a Privatemsg thread with multiple recipients in a Rules component?
I'd like to send private messages to a selected group of users. For this purpose I use a view with VBO and a Rules component action (utilizing the "Send message" action provided by Privatemsg) - as ...
2
votes
1
answer
177
views
How to display a form filled by a VBO-submission?
I'd like to use Privatemsg module to send messages to group of users. For this purpose I plan to use a view with Views Bulk Operations (VBO) and plenty of exposed filters.
I was able to create a ...
3
votes
1
answer
638
views
How to automatically modify a field after saving content?
I have posted this question on drupal.org (via a comment titled "field modification triggered by saving action"), but I realized that the thread is more than five years old. So I reproduce here the ...
1
vote
1
answer
394
views
Is it possible to create an action with derivatives?
Is it possible to create an action in Drupal 8 and point it at a deriver class to generate them automatically?
For example with Custom Publishing Options I have a ConfigurableActionBase action that ...
1
vote
1
answer
959
views
Define permissions for Actions?
function custom_mod_action_info() {
return array(
'custom_mod_delete_user_cats' => array(
'label' => t('Delete a users cats'),
'type' => 'user',
'configurable' => ...
3
votes
1
answer
903
views
How to create a custom event in rules?
I need to create an custom event for an action to be triggered in the Rules module.
Custom event is after completing the checkout process the page will be redirected to confirmation page. I need to ...
1
vote
0
answers
459
views
VBO custom action and submit functions from my module don't get called
I am trying to make my custom action for View Bulk Operations. My action works up to the point where I submit the form specified in assign_to_action_form. The watchdog statement in that function get's ...