- Patch #627626 by Damien Tournoud: fixed Node-specific code in file field.

merge-requests/26/head
Dries Buytaert 2010-01-20 17:25:54 +00:00
parent bf5a223dd1
commit 1f7aa07222
1 changed files with 3 additions and 10 deletions

View File

@ -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().
*
* Check for files that have been removed from the object.
*/
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.
if ($object->is_new || (isset($object->revision) && $object->revision)) {
if (!empty($object->revision)) {
return;
}