default value imagefield -> get from field collection item I've got a contenttype "gallery" with an imagefield "thumbnail", used in listviews oder teaserviews. This contenttype also has a field collection with "image", "title" and "description". So what would be great now, if there's no value set for the "thumbnail" field, the default value should be the value from the first field-collection image.

any chance to realize this? Thanks for your help

EDIT:

i tried this:

That's not a solution

function channelportal_gallery_node_presave($node) {

    $galleryimage = field_get_items('node', $node, 'field_gallery_and_caption');
    $firstimageID = $galleryimage[0]['value'];

    $item = field_collection_item_load($firstimageID);
    dpm($node-&gt;field_thumbnail);

    $node-&gt;field_thumbnail = field_get_items('field_collection_item', $item, 'field_gallery_image');
    dpm($node-&gt;field_thumbnail);
}


But nothing is stored, to the field, even if the first dpm gives back an empty array and the second one containing the values it should contain. But after all, nothing is stored to the field and it's empty again...

Thanks for your answer Chad Payne
I would look in to something like 

hook_node_presave

As a rough example I would have it work like this

function MY_MODULE_node_presave($node) {
     if(!isset($node-&gt;field_thumbnail)) {
          // load field collection and save that image to this image field
     }
}


I haven't tested this code but i think this would be the direction you would want to go in.