arabische
arabische

Reputation: 1

Drupal 7 Rules Module & PHP Evaluation "add a variable"

I'm trying to add a variable within an action of Rules Module of Drupal 7 , and I want to calculate the initial default value of that variable using PHP Evaluation input , But the problem is that I always get an empty value.

I left the Data selector zone empty and written in the PHP Evaluation zone this code:

return 4;

Could you please tell me why do I get always an empty value? and how to retrieve the result of PHP Evaluation input?

EDIT : Screenshot

Upvotes: 0

Views: 1986

Answers (2)

bmunslow
bmunslow

Reputation: 370

Rules is quite picky when it come to PHP Evaluation for added variables.

It will only work if the type of your variable is 'Text'.

What you can do if Text type doesn't suit your needs, is create a Text variable, give it the value you want and then convert it to the proper variable type with the 'Convert data type' action in rules.

Upvotes: 1

Anurag
Anurag

Reputation: 555

Just click on "Switch to Direct input mode" button at the bottom in value section and input the value directory in the field.

Upvotes: 1

Related Questions