Recoverable fatal error: Argument 1 passed to file_usage_list() must be an instance of stdClass, boolean given, called in /mnt/www/html/sasprelim/docroot/sites/all/modules/contrib/imce_private_files/imce_private_files.module on line 173 and defined in file_usage_list() (line 646 of /mnt/www/html/sasprelim/docroot/includes/file.inc).

When I enable the module and try to get it to work, the link will cause Drupal to experience technical difficulties, and the message above is listed in the log. Can't get it to work at this point; I'm hoping the error message helps.

CommentFileSizeAuthor
#5 RecoverableError-5.patch470 bytesrobbmlewis

Comments

hayzer created an issue. See original summary.

ldpm’s picture

Thanks. What version of Drupal are you running? Any specific steps to reproduce the problem?

hayzer’s picture

On 7.39.

The error appears when the module is enabled and I try to access a link. Disabling the module causes the error to go away.

Happy to try something more extensive if you like. I'm trying to get an intranet site up currently, so I'm testing serving of private files.

robbmlewis’s picture

I just ran into the same error, 7.53. I uploaded a file to the server for the theme banner. File in banner field was set to "public://web/banner2.png" and I couldn't get the banner to display. There was a managed file for this in the database, but it was for the temporary location during upload (Temporary://banner2.png). Tried to view the image directly (/system/files/web/banner2.png) and I got the error:

Recoverable fatal error: Argument 1 passed to file_usage_list() must be an instance of stdClass, boolean given, called in /home/thetroth/d7devel.thetroth.org/sites/all/modules/imce_private_files/imce_private_files.module on line 176 and defined in file_usage_list() (line 648 of /home/thetroth/d7devel.thetroth.org/includes/file.inc).

I disabled the module and it displayed correctly.

robbmlewis’s picture

StatusFileSize
new470 bytes

The issue looks to be file_load_multiple() comes back with 0 files, so it fails when using file_usage_list(). The patch checks to make sure that there are results, and if not return FALSE. Returning TRUE gives an access denied error.

ldpm’s picture

Thanks, I'll get that committed soon.