Domanda

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.

È stato utile?

Soluzione

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;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a drupal.stackexchange
scroll top