Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

In Drupal 7, i am setting up a rule. That rule is applying to trigger on the Node Save event.

  • After the node is saved [Condition] and the rule is properly triggered, then how can i get that saved Node Object ($node) from the Execute Custom PHP Code [Action]?

Because i put var_dump($node) (in the Custom PHP Code Box) but it doesn't work.

share|improve this question

1 Answer

up vote 1 down vote accepted

you can use watchdog("<pre>".print_r($node,true)."</pre>",'debug');then see the log in admin/reports/dblog also you can define your own action use hook_rules_condition_info(). This link may help.

share|improve this answer
So you mean, the output is just not visible but actually, i can directly use $node object from the Custom PHP (of my Rule) ? – 夏期劇場 Oct 8 '12 at 3:47
yes, Comments must be at least 15 characters in length. – bluesky_still Oct 8 '12 at 3:59
Comments must be at least 15 characters in length ??? @_@ what is it? – 夏期劇場 Oct 8 '12 at 4:05
Ok @bluesky_still, i know now the output is just not visible. I CAN USE THE NODE OBJECT $node FROM THERE. :) – 夏期劇場 Oct 8 '12 at 4:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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