If a user uploads a file on a status (image or anything), it causes the following error:

Warning: array_keys() [function.array-keys]: The first argument should be an array in file_entity_file_load() (line 142 of ***\sites\all\modules\file_entity\file_entity.file.inc).
Notice: Trying to get property of non-object in file_entity_image_dimensions() (line 175 of ***\sites\all\modules\file_entity\file_entity.file.inc).

Comments

Dave Reid’s picture

What module are you uploading from? It sounds like something is incorrectly calling file_load() or file_load_multiple()

jackman’s picture

i'm using the statuses module (fss) to upload images or media files

adamtong’s picture

I got error too.

Warning: array_keys() expects parameter 1 to be array, object given in file_entity_file_load() (line 169 of /home/mallbar/www/demo2/sites/all/modules/file_entity/file_entity.file.inc).
Notice: Trying to get property of non-object in file_entity_image_dimensions() (line 202 of /home/mallbar/www/demo2/sites/all/modules/file_entity/file_entity.file.inc).

Devin Carlson’s picture

Project: File Entity (fieldable files) » Statuses (Social Microblog)
Version: 7.x-2.0-unstable6 » 7.x-1.x-dev
Component: Code » Code (API)
Priority: Major » Normal
Status: Needs work » Active

As Dave Reid mentioned in #1, it looks like the Statuses module is calling file_load_multiple() with a file object instead of an array of file IDs.

IceCreamYou’s picture

Project: Statuses (Social Microblog) » Facebook-style Micropublisher
Component: Code (API) » Code - Functionality

Statuses itself doesn't handle file uploads. I suppose this could be in FBSMP

Dave Reid’s picture

Yep the bug is defininetly here: http://drupalcode.org/project/fbsmp.git/blob?f=libraries/file.inc#l32. I don't really see any reason why this function even exists and file_load() isn't being used instead.

adamtong’s picture

Hi, when i use media 7.x-2.x, the similar error shows:

Warning: array_keys() expects parameter 1 to be array, object given in file_entity_file_load() (line 155 of /public_html/sites/all/modules/file_entity/file_entity.file.inc).
Notice: Trying to get property of non-object in file_entity_image_dimensions() (line 188 of /public_html/sites/all/modules/file_entity/file_entity.file.inc).

mpark’s picture

Issue summary: View changes

Posted by Dave Reid on February 4, 2013 at 2:48am
Yep the bug is defininetly here: http://drupalcode.org/project/fbsmp.git/blob?f=libraries/file.inc#l32. I don't really see any reason why this function even exists and file_load() isn't being used instead.

Hello, any solution here Dave?

dqd’s picture

Title: file uploads with statuses bugs » file uploads with statuses bug causes errors and SWOD
Priority: Normal » Critical
Issue summary: View changes

Thanks Dave (#6) for pointing to the right direction. It also gets more weird with latest D7.28 release and changed behaviour in Drupal core, what can cause a SWOD by trying to upload an image via fbsmb. This can only be repaired by deleting the files and the database entries manually. Put this to Critical prio. I referenced it here #1624812: [META] Plan for FBSMP 7.x-1.x stable release.

(And I wrapped the OT error message into code tags.)

dqd’s picture

Issue summary: View changes
mathankumarc’s picture

I presume the fix I committed for #2168761: Attaching image results in PHP fatal error is the same fix for this also.