function file_field_presave
Implements hook_field_presave().
1 call to file_field_presave()
- image_field_presave in drupal-7.x/
modules/ image/ image.field.inc - Implements hook_field_presave().
Archivo
- drupal-7.x/
modules/ file/ file.field.inc, line 214 - Field module functionality for the File module.
Código
function file_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
// Make sure that each file which will be saved with this object has a
// permanent status, so that it will not be removed when temporary files are
// cleaned up.
foreach ($items as $item) {
$file = file_load($item['fid']);
if (!$file->status) {
$file->status = FILE_STATUS_PERMANENT;
file_save($file);
}
}
}