When i create a rule on the event "content is going to be viewed"
and set the condition to "check a truth value" and set the that value to "node:nid == 20"
and set a action to " grant user role".

The rule is activated on any node view.
any node the user visits the rule is activated and the user is granted that role.

i tired changing the condition value to " $node->nid == 20 ", now any node viewed even node 20 doesn't activate the rule, and the user isn't granted a role.

Someone please help

Comments

amitaibu’s picture

Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Component: Rules Engine » Documentation
Priority: Critical » Normal
Status: Active » Fixed

1) You should use the comapre text condition instead of the truth value.
2) If you use PHP don't forget the word return.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.