Im on d6.10 on apache 2 and php5 on ubuntu (But this happens in other platforms as well)
create a rule,
add an action,
add new number variable,
type in the number 123,
change label to "My Number",
change machine name to my_number
save it
add an "Execute custom PHP code" action with a weight of 10 so it executes after the one above
note at this point the system tells you that $my_number is a valide and available variable.
in the code write this: drupal_set_message("my_number was".$my_number,'warning');
save it and trigger it.
#
* 0 ms Content is going to be saved has been invoked.
* 13.753 ms Included MODULE.rules.inc files.
* 14.509 ms Executing the rule Switch trigger on rule set Content is going to be saved
* 14.803 ms Condition Saved content's field 'field_switch' has value evaluated to TRUE.
* 15 ms Condition Saved content is wxrecord evaluated to TRUE.
* 15.172 ms Warning: Unable to get variable number.
* 15.24 ms Element Add a new number variable has not been executed. There are not all execution arguments available.
* 15.362 ms Action execution: Execute custom PHP code
* 15.46 ms Warning: Unable to get variable my_number.
* 15.481 ms PHP is not evaluated as there are not all necessary variables available.
* 15.569 ms Evaluation of Content is going to be saved has been finished.
I think what happens is that even though we are given the ability to edit the machine name of the variable, it looks likes it is hardcoded to look for *number* instead of the real unique name I entered , this happens with all variables like this. so we are limited to one of each variable since we cant change the unique name.
Comments
Comment #1
fagooh, perhaps it's related to #401658: Fatal error on php intelligent saving. I have to to take a look at it.
Comment #2
fagono, it wasn't related. I was able to reproduce it and I fixed it. Please test the next development snapshot.
Comment #3
redijedi commentedRunning into the same problem. Please post patch.
Comment #4
fagoIt's in the dev version, just install the development snapshot.
Comment #5
spydmobile commentedThanks Fago, I can confirm this fixed the issue!
Franco