Problem/Motivation

Lots of errors when file is deleted that was referred to from a node and then the node is deleted.

Steps to reproduce

  1. Create a content type
  2. Add a file field to the content type
  3. Create a node of that content type and upload a file to the file field
  4. Go to the file admin page: admin/content/file
  5. Delete the file
  6. Go to the content admin page: admin/content
  7. Delete the node
  8. You should see errors like below

Notice: Undefined property: stdClass::$fid in file_usage_list() (line 615 of /xyz/includes/file.inc).
Notice: Undefined property: stdClass::$status in file_field_delete_file() (line 348 of /Users/kristen/sites/my-site/modules/file/file.field.inc).
Notice: Undefined property: stdClass::$fid in file_usage_delete() (line 694 of /xyz/includes/file.inc).
Notice: Undefined property: stdClass::$uri in file_delete() (line 1237 of /xyz/includes/file.inc).
Notice: Undefined property: stdClass::$uri in file_delete() (line 1238 of /xyz/includes/file.inc).
Notice: Undefined property: stdClass::$uri in file_delete() (line 1242 of /xyz/includes/file.inc).
Notice: Undefined property: stdClass::$uri in file_delete() (line 1244 of /xyz/includes/file.inc).
The specified file could not be deleted, because it is not a valid URI. More information is available in the system log.

Proposed resolution

Not sure. Should we be able to delete the file if it is being referenced? If so, should it automatically remove it from all entities that reference it?

Remaining tasks

  1. Figure out best approach
  2. Implement it!

User interface changes

n/a

API changes

n/a

Comments

Title:Lots of notices when a file is deleted first and then the node that was pointing to the imageLots of notices when a file is deleted first and then the node that was pointing to the file

Issue summary:View changes

typo

Issue summary:View changes

removed path info

Hi Kristen Pol ,

Is there any update to fix those errors???????