Use case: a small site where I want to warn all users by mail whenever a new content of a particular type is created. I thought I would try Rules+Actions to handle this.

I'm working on a vanilla Drupal 8 test site on my workstation, so there is just "Article" and "Basic Page".

I've installed the Rules module ok. I've looked at several videos explaining how this works in Drupal 7 and they looked reasonable straightforward. Now I'm trying to do something in D8 and finding it less than obvious.

Specifically, I've created the rule to fire when new content is created, and now I'm on a page editing Condition, where I want to specify that the node type is "Article". Using "Data selection" mode in the "Entity" field I select "node.type". This seems logical, but what on earth do I put in "Type"? No matter what I put I get a message something like this: "Data selector node.entity for context Entity is invalid. Unable to apply data selector 'entity' at 'entity' " - which is about as unexplicit as you can get.

Maybe I'm jumping the gun and Rules is not usable yet? Or maybe I've just not understood it at all...

But I would really appreciate if somebody could explain to me what seems quite straightforward in principle. How do I add a condition to my Rule that will cause the rule to fire only on a specific content type?

  • Which version of the Rules module are you using? If it is the most current ALFA release, which I suspect, then "patience" is probably your only possible solution (apart from contributing patches yourself to get it to work). – Pierre.Vriens Dec 12 '16 at 16:28
  • Indeed it is 8.x-3.0-alpha2 – Martin K Dec 12 '16 at 16:30
  • Rules is not ready for use yet. – mradcliffe Dec 12 '16 at 18:58
  • Any idea when Rules for D8 will be ready? I'm also trying to do something similar. – Magick Dec 14 '16 at 14:05
  • Is Drupal 8 ready for this in the meantime? And what is the correct answer to this question? – drupalfan Aug 29 '17 at 19:30

Answering the "what do I put in the 'type' box?" question, the answer appears to be the same as for D7 - that is, the same status you'd pass to drupal_set_message().

This gives you options of:

  • status
  • warning
  • error

As to the state of D8 and specifically D8 rules, I share your pain - and it's nine months since you asked the question!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.