Rules in D8

Hi all,

Has anyone had any experience with Rules in D8? I used it extensively in D7, but I am finding the D8 version impossible to make sense of. There is zero documentation online - at least, there is but it leads to blank pages, for example… https://www.drupal.org/docs/8/modules/d8-rules-essentials/data-selection … Or there is this which is linked from the Rules module on my site: https://www.drupal.org/node/1300042#comment-12358861 but, like as that commenter have said, it just doesn’t make any sense in D8.

Specifically, I am trying to understand how the data selectors work. I don’t understand the D8 equivalences (eg. for [node:body]), not sure what I’m looking for in the drop-down lists, and as for trying to work out the data selector for “if X field is selected then…” I have included a screenshot where I am trying to select content type = “Friday Links” and… I really have absolutely no idea what to do next.

Moreover the data selectors have changed in D8. It used to be [node:title] or [node:body]. Now it’s {{node.type.entity}} (or something) and I cannot find anything online which explains what’s what.

Can anyone help explain the D8 version of Rules, and what data selectors are supposed to go where with what syntax? Free coffee for a week if you can help me :slight_smile:
Thanks!
Cath

19

Hello Cath,

I attended a meeting about Rules in the last Drupal Europe and I was quite discouraged regarding the stability of the project.

My conclusions from the meeting was that the module is currently in an alpha, non-stable version and it is very difficult to use it. On top of that most likely it is also unsafe and it can easily break your website. In general the migration project was in around 70% of completion and they were looking for resources in order to finish it.

My suggestion for now would be to create something custom based on your case. The Rules module provides you an interface through which you can set the rules. If you are aware of the rule that you want to use, the you can develop it on your own. That’s just a suggestion though.

If you have more questions on how to implement something like that, I would be glad to help you.

Best Regards,

Kostas

Hi Kostas,

Thanks for the news about Rules - it is rather disappointing that such an important module is no longer sustained, or indeed has anything to replace it.

I am also rather concerned at the direction Drupal is heading generally - it was presented as a “building websites without needing to know how to code”, but it increasingly looks like ‘knowing how to code’ is becoming a prerequisite for D8 (which causes me a lot of problems as I am not a programmer and have no coding knowledge). Anyway… that’s a general rant I have about D8, not something directed anyone specifically :slight_smile:

While in principle, it would be nice to have something which works, I actually have quite a few sites which use Rules, so I would need custom code for all of them. So while on a case-by-case basis this can be fixed with some coding knowledge, I am also not happy with the idea that we need to insert custom code in the first place… this doesn’t feel very sustainable and if, as you say, Rules is THAT unstable, I am uneasy with using its interface to do something.

Given the other problems I’m having with D8 at the moment, I think I will leave Rules alone for now. I will have a look and see if “Workflow” or “Trigger” modules can do something, and will post here if I can work something out.

Kostas I might get you a free coffee in any case, as you help me a lot on other stuff :slight_smile:
-cath

After quite a lot of research here… the “Plan B” alternative which doesn’t require custom coding is described in the following post:

The only limitation (as far as my needs are) is that I can’t publish the content body in the email; it’s more designed to be a ‘notification’ that content at has been published. At the moment I can’t see how to include and format a node body in the ‘mail’ field (it also requires the D8-style tokens involving ! and @, but the tokens available are extremely limited).

So… a tiny step forwards, but until Rules is made sitebuilder-friendly rather than developer-friendly… it’s all I can find.

Maybe there’s a magic module that allows me to send an email to the website which converts it into a node…?! A quick google search suggests there is (several modules needed actually)… but wow it’s getting complex. Or there’s a Views/Mail mashup which might do the job but… oooof…Bring back Rules!!!

Hey Cath,

Thank for the coffee proposal :grinning: By the way, this module looks like a good alternative.

The “issue” in general with open source projects is that they are community dependent meaning that the number of functionalities that Drupal can have depends only on the community. Drupal 7 looked more like a site building tool because the community was more active and provided more tools. Drupal 8 on the other hand is less mature because the community is not so active.

At CERN we try to provide more and more site building tools so that the users will have to do the minimum site building work.

Kostas