- Patch #627626 by Damien Tournoud: fixed Node-specific code in file field.
parent
bf5a223dd1
commit
1f7aa07222
|
@ -243,21 +243,14 @@ function file_field_prepare_view($obj_type, $objects, $field, $instances, $langc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Implements hook_field_insert().
|
|
||||||
*/
|
|
||||||
function file_field_insert($obj_type, $object, $field, $instance, $langcode, &$items) {
|
|
||||||
file_field_update($obj_type, $object, $field, $instance, $langcode, $items);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements hook_field_update().
|
* Implements hook_field_update().
|
||||||
|
*
|
||||||
|
* Check for files that have been removed from the object.
|
||||||
*/
|
*/
|
||||||
function file_field_update($obj_type, $object, $field, $instance, $langcode, &$items) {
|
function file_field_update($obj_type, $object, $field, $instance, $langcode, &$items) {
|
||||||
// Check for files that have been removed from the object.
|
|
||||||
|
|
||||||
// On new revisions, old files are always maintained in the previous revision.
|
// On new revisions, old files are always maintained in the previous revision.
|
||||||
if ($object->is_new || (isset($object->revision) && $object->revision)) {
|
if (!empty($object->revision)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue