Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49197

[Solved] Attempting to Build Custom PHP rule

$
0
0

I am building a scheduled publishing rule set. I would like to have a php action that resets the created date on the node to the scheduled publishing date as the node is published. I found a clue in the issue que: http://drupal.org/node/641590

The Execute Custom PHP action pane states:

Furthermore you can make use of the following variables:

Variable Type Description Intelligent saving
$publish_content__content content Content {argument} Yes

So I wrote the following code snippet:

<?php
$publish_content__content 
->created = $publish_content__content    ->field_publish_date;
return array(
"node" => $publish_content__content);
?>

Which generates the following error message:

0.23 ms Action execution: "Execute custom PHP code"
0.343 ms Unknown variable name "node" return by action "rules_action_custom_php".

Clearly the "node" in the return statement isn't right. I'm too new to both Drupal and php to know why it doesn't work. I'd appreciate help from more experienced travelers!


Viewing all articles
Browse latest Browse all 49197

Trending Articles