Hi everybody,
I have problem with the action "Fill in a Field" for CCK-Fields.
I'm generating JPGs with a little script (which saves the picture into a folder) and wanted to save this picture within a FileField of my content type. For this I worte this PHP-Code to fill the field:

return array(
0 => array(
'filename' => $node->nid.'.jpg',
'filepath' => 'sites/default/files/plakate/'.$node->nid.'.jpg'
) );

But it doesn't attatch the File to the FileField. Where is the problem? Is there something missing?

Greetings
lundj

Comments

lundj’s picture

Hello everybody,
My translation was not correctly - the action is called "Populate a Field (CCK)"
There I put my custom php-code (see first post) into the section "run custom PHP". The script should take an image - which is processed by a script on saving/updating the content-type - an put it into a FileField. But the action doesn't work - the picture would not be assigned to the FileField...

How can I fix this?

Kind regards
lundj

itangalo’s picture

Status: Active » Fixed

I'm not sure, but I think the file fields store absolute paths, meaning that you'll have to start it with http:// and all of that.

Please reopen if this doesn't help. Good luck!
//Johan Falk
I'm a part of the Rules Issue Squad, helping out in the issue queue. You can join, too!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mitchell’s picture

Component: Provided Rules integration » Rules Core

Updated component.