Ask Freelock: ECA vs Rules
Yesterday a client asked us to install Rules module (again, repeating an earlier request, when he had missed my answer that we had installed ECA instead).
Yesterday a client asked us to install Rules module (again, repeating an earlier request, when he had missed my answer that we had installed ECA instead).
Since the 2024 election, the BlueSky social network has exploded in popularity, and appears to be replacing the cesspool that used to be Twitter. I'm not much of a social media person -- I much prefer hanging out in smaller spaces with people with shared interests. If you're like me, I would highly recommend finding a Mastodon server that caters to your interests, where you're sure to find rewarding conversations.
Our Yacht Club client has three workslips that members can reserve for up to 3 days. Using core taxonomy, content types, views, and the Events, Conditions, and Actions (ECA) module, we built a system to allow members to make reservations, and have the system prevent double-bookings.
The ECA Helper module provides an action to make an arbitrary HTTP post to any URL. That's all that's necessary to post to Mastodon from Drupal, if you have a Mastodon account. I've been using this functionality to automatically post these advent calendar posts for the past week.
The saying goes, there are two hard problems in computer science: caching, naming things, and off-by-1 errors. While Drupal certainly has not solved the naming things, it has made a valiant attempt at a decent caching strategy. And for the most part it works great, allowing millions of lines of code to load up quickly the vast majority of the time.
This is more a tip about our favorite automation tool, the Events, Conditions, and Actions (ECA) module, and how it can get you out of a bind when Drupal caching goes too far.
Another automation we did for Programming Librarian, a site for librarians to plan educational programs, involved events. They wanted to always feature 3 events on the home page, and the most important events were in the future. If their schedule is full, they wanted 2 future and 1 past event visible -- but they don't always have upcoming events, so there might be 0, 1 or 2 future events, and 3, 2, or 1 past events.