You are here

function upload_replace_file_delete in Upload File Replace (for filefield CCK) 7

Same name and namespace in other branches
  1. 6 upload_replace.module \upload_replace_file_delete()

Implements hook_file_delete().

Update the URI in the file object before deleting as we may have altered it above.

File

./upload_replace.module, line 152
A module file for providing functionality to replace files on upload.

Code

function upload_replace_file_delete($file) {
  $file->uri = db_select('file_managed', 'f')
    ->fields('f', array(
    'uri',
  ))
    ->condition('f.fid', $file->fid)
    ->execute()
    ->fetchField();
}