ECA: Event - Condition – Action module, an alternative to Rules module in Drupal 9 / 10

Category:

Many people from Drupal 7 know Rules module which is one of the best module to do so many things with Drupal such as Sending an email to admin when user login, Calculate a value automatically when the form is saved. Even Drupal Commerce and Ubercart in Drupal 7 also implement using Rules module.

 

This is changed in Drupal 8 / 9, Rules module in Drupal 8 / 9 is never reach stable release and Business Rules Module is released. Therefore, we have 2 options :

 

  1. Rules module – It is still in alpha state as of today. The module works great for my task but to make it work is not easy. To find Entity / Type / Value could take a couple days or couple weeks. A lot of thing that is easy to work with Rules module for Drupal 7 is quite difficult to work in Drupal 8 / 9.
  2. Business Rules module – which I heard it’s great but from my own experience, I can’t even try it. Got an error since the installation a few years ago. I really can’t remember what was it but I remembered that I have checked the issue queue and found some people got same problem but there is no solution to those who got the problem. So, no go for me.
  3. Then, option 3 ECA: Event - Condition – Action module appears about last year. However, ECA module support only Drupal 9 and above.

2 months ago, I just have a chance to play with this new ECA module. The good thing about ECA module is, most of the things I can do with Rules module, can replaced with ECA module. (I said most because I still have a couple things that I need to try.) And it’s very easy replacement. When working with Rules module, I took like a couple days or couple weeks to make thing works since I have to guess which value should I enter to make it work. With ECA module, most of the time I work with token and a bit of field name, it really works without having to guess.

 

Things that I used to use Rules module and ECA module can be used as a replacement :

  1. Send Email to admin when anyone login
  2. Duplicate Data from a field to another hidden field as a checking value.
  3. Calculation of field value.
  4. Change value in field when clone a new content.

 

Things that ECA module can do so that you don’t need to install another module :

  1. Prepopulate Data with URL, this can be a replacement for Prepopulate / Entity Prepopulate module.
  2. Auto Content Title

 

Thing I can do with Rules module and will find sometime to try that in ECA module.

  1. Drupal Commerce, I need a customer comment that I can choose to just show it in an order for both admin and customer can see. An admin can choose to email to customer if needed. The issue 2908196 started since Sep 2017 and then closed since developer just focus only admin comment in that issue even though there is a patch for customer comment in that issue. Then, a new issue 3267366 created in Mar 2022. There is a patch in there but never get committed. With Comment Entity and option field, this works great with Rules module.

Rules module is a great module and it works great for the task I really need but I’m afraid of using Rules module in everything like what I did in Drupal 7 since it’s still in Alpha state which I don’t know if anything will be changed later and might cause the Rules module to stop working. So, I only use Rules module when I really need it.

 

With ECA module as an alternative, I can start working on anything I can think of in ECA module and not to worry about anything change later that break what I already created.

 

I just hope that one day, Rules module will have stable release and I’m sure I will try it again.