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

Kristen Pol’s picture

Title: Lots of notices when a file is deleted first and then the node that was pointing to the image » Lots of notices when a file is deleted first and then the node that was pointing to the file
Kristen Pol’s picture

Issue summary: View changes

typo

aimeerae’s picture

Issue summary: View changes

removed path info

thirupathi43’s picture

Hi Kristen Pol ,

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

besja’s picture

Hi,
We have the same error. Is there any solution?

Version: 7.23 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.