Hello, short description:

content-type called event with cck date field with d/m/Y format.
content-type called profile with birthday date field with d/m/Y format.

Using profile content-type as profile (using content-profile module).

New rule:

When creating a new user do the next:

- Create new event (ok).
- Load user profile (the one just registered, ok).
- Populate cck field -------- ERROR!

Can't add tokens and should be totally possible, not a token of the full date, neither using the token of the day, month and year.

I load the user profile to have access to its values as tokens and I can use them but if I put them in the populate cck field action I got an error as "Date is invalid" just for having a custom format.

¿How can I do that?

Kind regards!

Comments

Wallack’s picture

Component: Rules Core » Rules Engine

This is how I solved it:

1 .- Enable the PHP filter.
2 .- Add new action (PHP: Custom PHP code (or something like that)).

There you will see the available variables like: $node, $node_added ...

And what I did:

$node_added->field_date_event[0]['value'] = $node->field_date[0]['value'];

Works perfectly with taxonomies and a lot of things and solved a lot of problems to me.

Kind regards.

arkjoseph’s picture

Excellent, I will give your code a try on my site. I have a similar situation where I need an content admin to be able to update a referenced node when another node reference field is selected.

tr’s picture

Component: Rules Engine » Rules Core
Issue summary: View changes
Status: Active » Closed (outdated)