This module provides helper functions and quick actions for the ECA (Event, Condition, Action) system in Drupal. It enables users to perform tasks like making HTTP requests, manipulating form elements, managing cookies and headers, and interacting with Drupal services directly within ECA configurations without needing to create custom plugins.
Add helpers functions for ECA
Events
- Preprocess event
- Status message event
Actions:
- Simple http request, if response data is json you can access with [token_name:json:response_data_key]
- Workflow label
- Workflow state
- Get $_SERVER, $_COOKIE, $_SESSION, $_ENV, $_GET, $_POST variable
- Set cookie value for response
- Form Set any form element field value by key
- Form Get any form element field value by key
- Form attach library
- Form add css class
- Form dumper data (dev)
- ThirtPartySetting Get/Set value
- Preprocess Get/Set value for variables
- Preprocess attach library
- Preprocess add css class
- Preprocess remove item
- Headers Set/Remove values
- Add custom tag/script/style to header, body top, body bottom
- Alter status messages
ECA Quick Action
Create quick action for ECA without need define plugin and module.
Create file docroot/sites/eca/EcaActions.php
<?php
/**
* Define the ECA quick actions.
*
* Define action id, label, and callback, service.
*/
function ECAQuickActions(): array {
return [
"hello" => [
"label" => "ECA Action Hello",
"callback" => "eca_quick_actions_hello"
],
"hello_inline" => [
"label" => "ECA Action Inline",
"callback" => function ($hello) {
\Drupal::messenger()->addMessage('Inline callback' . $hello);
}
],
"hello_service" => [
"label" => "ECA Action Call Drupal service",
"service" => "messenger",
"callback" => "addMessage"
]
];
}
function eca_quick_actions_hello($hello) {
\Drupal::messenger()->addMessage('Hello world: ' . $hello);
return "Hello world: " . $hello;
}
Use ECA Helper: Quick Action and choose the ECA Action Hello
SUPPORT DEVELOPMENT
Donation vith Paypal by email: [email protected]
Depends on
Dependencies of the latest stable release
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 3.0.0-beta4 | Pre-release | 10–11 | Fix default value JSON Encode/Decode | Oct 30, 2025 | |
| 3.0.0-beta3 | Pre-release | 10–11 | Fix Action Preprocess add css class | Oct 9, 2025 | |
| 2.0.10 | Stable | 10–11 | Oct 9, 2025 | ||
| 3.0.0-beta2 | Pre-release | 10–11 | Prevent DIC RuntimeException when kernel service unavailable during Drupal installation | Oct 2, 2025 | |
| 3.0.0-beta1 | Pre-release | 10–11 | Release support for ECA V3 | Sep 18, 2025 | |
| 3.0.x-dev | Dev | 10–11 | Sep 18, 2025 | ||
| 2.0.9 | Stable | 10–11 | Aug 25, 2025 | ||
| 2.0.8 | Stable | 10–11 | Fix get token value | Aug 5, 2025 | |
| 2.0.7 | Stable | 10–11 | Fix 'Trait' namespace, Add DateFormatToUnix action | Aug 4, 2025 | |
| 2.0.6 | Stable | 10–11 | Update HttpRequest, Add cookie domain, update const define | Jul 25, 2025 | |
| 2.0.5 | Stable | 10–11 | Add new Action for ECA Helper | May 29, 2025 | |
| 2.0.4 | Stable | 10–11 | Add HEAD request method for Action HTTP Request | Apr 24, 2025 | |
| 2.0.3 | Stable | 10–11 | Update check message is string for Action Alter status messages | Feb 7, 2025 | |
| 2.0.2 | Stable | 10–11 | Add new actions for Status message, header tag, script, markup | Jan 3, 2025 | |
| 2.0.2-beta7 | Pre-release | 10–11 | New Action Add header footer tag and script | Dec 31, 2024 | |
| 2.0.2-beta6 | Pre-release | 10–11 | Update Action set/remove response headers | Dec 20, 2024 | |
| 2.0.2-beta5 | Pre-release | 10–11 | Update Action Set cookie path | Dec 20, 2024 | |
| 2.0.2-beta4 | Pre-release | 10–11 | Add HTTP Client support multipart upload files, Add Action Set cookie | Dec 20, 2024 | |
| 2.0.2-beta3 | Pre-release | 10–11 | Add HTTP Client support multipart upload files | Dec 16, 2024 | |
| 2.0.x-dev | Dev | 10–11 | Update #3494034 Add support for multipart files upload | Dec 15, 2024 | |
| 2.0.2-beta2 | Pre-release | 10–11 | Add Preprocess remove item, Update http request add json token | Dec 12, 2024 | |
| 2.0.2-beta1 | Pre-release | 10–11 | Add Preprocess event, actions and ECA Quick Action | Dec 11, 2024 | |
| 2.0.1 | Stable | 10–11 | Release v2.0.1 | Nov 8, 2024 | |
| 2.0.1-beta10 | Pre-release | 10–11 | Fix Options in HttpRequest are ignored | Oct 17, 2024 | |
| 2.0.1-beta9 | Pre-release | 10–11 | Add replace token for cookie, headers, options | Oct 16, 2024 | |
| 2.0.1-beta8 | Pre-release | 10–11 | Add workflow state action and get-set third party setting | Oct 2, 2024 |