---
title: "Event-Condition-Action (ECA) module"
date: "2023-08-16T15:41:02+00:00"
summary: "Discover how to integrate Event-Condition-Action (ECA) with Drupal 9 and Site Studio. Learn about compatibility issues, patches, and solutions for seamless implementation of this powerful automation module."
image:
type: "page"
url: "/drupal-starter-kits/add-ons/site-studio/event-condition-action-eca-module"
id: "1d95d544-2e76-409d-93da-9bf83eb28de4"
---

Event-Condition-Action (ECA) is a rules engine for Drupal. The core module acts as a processor that validates and executes event-condition-action plugins. For more information, visit the [ECA: Event - Condition - Action](https://www.drupal.org/project/eca) page on Drupal.org.

Expected error when integrating the ECA module with Site Studio
---------------------------------------------------------------

If you install the ECA module and run a Site Studio rebuild, the process might fail with the `[error] expected selector` error.

To resolve this error and prevent the Site Studio API from processing ECA tokens, apply the following patch:

    diff --git a/src/Services/CohesionUtils.php b/src/Services/CohesionUtils.php
    index 075e754589..5fbec297dc 100644
    --- a/src/Services/CohesionUtils.php
    +++ b/src/Services/CohesionUtils.php
    @@ -252,7 +252,7 @@ class CohesionUtils {
    
          if ($found_tokens = $token_service->scan($value)) {
            foreach ($found_tokens as $context => $token_group) {
    -          if (in_array($context, array_keys($token_info['types']))) {
    +          if (in_array($context, array_keys($token_info['types'])) && $context !== '_eca_root_token') {
                foreach ($token_group as $token) {
                  $context_variable = str_replace('-', '_', $context);

This solution is not part of a Site Studio release and is specific to the ECA module.