0

I set Content is going to be saved for Rules Event.

And then the following code in Execute custom PHP code for Rules condition. But it seems to return always TRUE no matter if the user account of node author is Active or Blocked.

return $author->status = 0;

How can I check the user status of node author in Rules condition? I would like the condition which returns TRUE when the the user status of node author is Blocked.

2
  • Drupal 6 end-of-life announcement
    – No Sssweat
    Commented Feb 27, 2016 at 6:37
  • 1
    Please edit your question to include more details about your actual rule, like a screenprint of how your rule looks like (using the Rules UI) or something similar. Without that it'll be terribly tough for anybody to help you figuring out what the actual answer to your question is. Commented Feb 27, 2016 at 7:08

1 Answer 1

1

You need to use the double equation sign. What your code does right now, is that it assigns the value 0 to $author->status.

Here's updated code:

return $author->status == 0;
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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