phpdrupal-7drupal-rules

In the drupal 7 rules module's execute custom php action how can I find out what the $site variable specifically contains?


To preface, I am relatively new to php. I need to use the 'execute custom php' action in the rules module to set the value of one of my user fields, but I haven't been able to figure out how to access that field from the $site variable that is available. I know how to print_r the contents of $site and find what I am looking for from there(and I have used that before in nodes successfully), but since I am in the rules module if I just print_r($site) the result doesn't show up anywhere that I know of. What is a good way to find out the contents of the $site variable?

I apologize if this is not clear!


Solution

  • This is the answer someone else gave on another site: "Maybe you can log it to the screen with drupal_set_message or to the drupal logs with watchdog." I used drupal_set_message and it worked.