function filefield_uuid_node_features_rebuild_alter in UUID Features Integration 6
Same name and namespace in other branches
- 7 includes/modules/filefield.inc \filefield_uuid_node_features_rebuild_alter()
Implementation of hook_uuid_node_features_rebuild_alter(). Replace filefield uuid's with a field array suitable for node_save().
File
- includes/
modules/ filefield.inc, line 70 - uuid_node hooks on behalf of the filefield module.
Code
function filefield_uuid_node_features_rebuild_alter(&$node, $module) {
$types = content_types();
if (!empty($types[$node->type])) {
// Find CCK nodereference fields.
foreach ($types[$node->type]['fields'] as $field) {
if ($field['module'] == 'filefield') {
$field_name = $field['field_name'];
// Loop through all values of the field.
foreach ($node->{$field_name} as $delta => $data) {
$fid = uuid_get_serial_id('files', 'fid', $data['uuid']);
$file = field_file_load($fid);
$node->{$field_name}[$delta] = $file + $data;
}
}
}
}
}