I have a content type "order" that when created also creates a content type "job". I have this working well except for this: The order content type has a "date_required" field (datetime) and the "job" content type has a "date_scheduled" field(datetime). I need to subtract 14 days from the date_required field and populate the date_scheduled field. I've had no problem moving the actual date from "order" to "job":
return array(
0 => array('value' => '[node:field_order_date-datetime]');
);
I am having trouble using php functions (strtotime) inside the PHP advanced code field. I'm a designer so my php skills are lame. Any help would be greatly appreciated.
BTW, this module is sweet!
Comments
Comment #1
selwynpolit CreditAttribution: selwynpolit commentedI am trying to do something similar. I want to write the current date into a date field. I am able to write other values into other fields. I found lots of references to it in issue queue but can't seem to make it work.
I put the following into Advanced: Specify the fields value with PHP code
Here are some of the variations I have tried. Can anyone shed some light in this?
Comment #2
dogboy72 CreditAttribution: dogboy72 commentedThis should help you:
https://drupal.org/node/331000#comment-1101183
Comment #3
selwynpolit CreditAttribution: selwynpolit commentedThanks for that. I think I could do it in a module but I really wanted to do it from within rules. Not sure if there is something really obvious that I am missing. The instructions on screen in rules show a simple example which I tried but I can't seem to make it work at all. I have spent way too many hours on this of course.
Comment #4
selwynpolit CreditAttribution: selwynpolit commentedI tried writing a text value from the advanced code field into a text field and I don't seem to be able to do that either. I tried all kinds of variations but it didn't seem to work. Has anyone tried this? Seems like it should be pretty simple, right?
If I have a field called field_my_text:
ok, it seems like you don't need the <?php?> tags
Appreciate any suggestions.
Comment #5
TR CreditAttribution: TR commentedDrupal 6 is no longer supported, and things work differently in Rules for D7 and D8.