Hi All,

I am trying to set up some rules using the Rules module, and I am looking for the "Execute custom PHP Code" option .. but no matter what I try, this option doesn't come up anywhere (not under the condition nor under action).

What are the requirements for this option to appear? Any particular modules installed or anything else?

Thanks for your help

Comments

peterjlord’s picture

This is just a guess really but have you got the PHP filter module enabled.

anujdeo’s picture

That was my silly mistake.. I am new to drupal. Thanks :)

mr. chips’s picture

Turning on PHP Filter module (in core) did it. Now I have the Execute custom PHP code option.

eljefejb’s picture

I just encountered the same problem. Thanks Peter and mr. chips!

maneesh_thakur’s picture

Hello,

I have "Execute custom PHP Code" enabled in rules module.

My Requirement:

- Author 'A' creates a node.
- Admin should be able to create a table of contents for the article created by Author 'A'.
- With the custom php code, I should be able to read the data from node and append some more data to the node and save it back.

Do let me know,pointers If any to achieve this task.

Regards.

peterjlord’s picture

Should be able to load the node with rules so you will have access to the node level.

// dsm($node) to see the node object need devel module installed

$node->field[0]['value'] = "Some stuff";

return array("node" => $node);