Posted by B4n7o on August 6, 2009 at 12:05pm
| Project: | Rules |
| Version: | 6.x-1.x-dev |
| Component: | Rules Engine |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I have two fields field_number_total
and field_number_unapproved
the unapproved value is a calculated field
then once the node is approved, the field_number_total must take on the value of field_number_unapproved
there is an option for the token, but the token does not fit in the field, there is also an option to use php, but im not that comfortable using it, as iv managed to break the db with the code iv tried.
Comments
#1
What do you mean by "the node is approved"?
What event are you using in your rule?
What do you mean by "the token does not fit in the field"? It does not get replaced?
Are you sure this is related to the form support of Rules? Do you use any of the form events/actions?
#2
Sorry about this
I also have a field_approval which is a select list, options "yes" and "no"
then using views, i have these element all in a table, with field_approved as an editable field.
once you select yes as the approved option,
in rules
the event is
after updating existing content
then the condition is
field has value
then i select my "field_approval" field and select the "yes" option
so no the event will occur when "yes" is selected in the opproval field.
adding an action
"Populate a field"
select my "field_number_total"
and in there i want to use the token from my "field_number_unapproved"
the idea is to make the value of the total the value of the calculated field, once the the field_approval is selected.
here is where the issue is, you can use a token in this field, it asks for integers only, and you can only put 10 characters in the field, so it only writes the first few letters of the token anyway!
can you help with an alternative?
#3
Hi B4n7o,
I would suggest to use "Advanced: Specify the fields value with PHP code" in your "populate a field" rule.
It's not hard, try something like the following:
<?phpreturn array(
0 => array('value' => $node->field_number_unapproved[0]['value']),
);
?>
#4
Although I faced simular space problems in other rules form fields. PHP execution is great, but the space for inserting more complex php code is often too limited. E.g. for going through an array variable per foreach (as used in multiple cck fields).
A little bit offtopic though...
#5
So this is not related to Rules forms support.
#6
#7
Automatically closed -- issue fixed for 2 weeks with no activity.