Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
Dave ReidWhat module are you uploading from? It sounds like something is incorrectly calling file_load() or file_load_multiple()
Comment #2
jackman CreditAttribution: jackman commentedi'm using the statuses module (fss) to upload images or media files
Comment #3
adamtong CreditAttribution: adamtong commentedI 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).
Comment #4
Devin Carlson CreditAttribution: Devin Carlson commentedAs 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.
Comment #5
IceCreamYou CreditAttribution: IceCreamYou commentedStatuses itself doesn't handle file uploads. I suppose this could be in FBSMP
Comment #6
Dave ReidYep 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.
Comment #7
adamtong CreditAttribution: adamtong commentedHi, 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).
Comment #8
mpark CreditAttribution: mpark commentedHello, any solution here Dave?
Comment #9
dqdThanks 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.)
Comment #10
dqdComment #11
mathankumarc CreditAttribution: mathankumarc commentedI presume the fix I committed for #2168761: Attaching image results in PHP fatal error is the same fix for this also.