I am using this module as part of the panopoly distribution. After updating this recently from 1.47 to 1.49, which updated file_entity from 2.0-beta3 to 2.12, I started to get a lot of these warnings:
Warning: Invalid argument supplied for foreach() in file_entity_set_title_alt_properties_on_file_fields() (line 245 of /srv/www/html/build/html/profiles/panopoly/modules/contrib/file_entity/file_entity.file.inc).
In my case, this is related to a solr document entity that is handled by Sarnia, so I'm not entirely sure where this should be fixed.
The warning is created because file_entity tries to loop through the field items, assuming that each item is an array. In the case of solr documents created by the Sarnia module, this doesn't seem to be the case for all items.
Comments
Comment #2
berliner CreditAttribution: berliner commentedThe attached patch removes the warnings in my setup.
As I said, I'm not sure where this should be fixed, but I can't see a functional problem with this patch and it removes the warnings.
Comment #3
rblackmore CreditAttribution: rblackmore as a volunteer commentedberliner's patch removed the warnings in my dev environment (mysql 5.5.57 / PHP 5.6.31). My testing was very brief, but after applying the patch there were no obvious problems with Sarnia, Media or Media WYSIWYG: Search results still return and media uploads still work.
Comment #4
joseph.olstadok, we're planning a new release of file_entity very soon (in the next 7 days) , I'll have a closer look at the patch soon, consider it for the upcomming release.
Comment #5
joseph.olstadsee #2934201: Plan for file_entity release 7.x-2.14
Comment #6
joseph.olstadI'm a bit unsure of this change, it's not clear to me if items are always expected to be arrays , I'm a bit apprehensive about committing this and then having a regression in some other situation so I'm going to postpone it until 7.x-2.15.
please upgrade to 7.x-2.14 and re-apply this patch if you still need it.
Comment #7
joseph.olstadThis could be added to 2.16 but I'd appreciate a few test examples to help review.
Comment #8
GarChris CreditAttribution: GarChris commentedPatch worked for me. Just a note: make sure you are using the latest stable version (7.x-2.15) or patch may not apply correctly. Thanks Berliner
Comment #9
muckermarc CreditAttribution: muckermarc commentedWorks for me too, file_entity 7.x-2.15 and sarnia 7.x-1.13. Thanks!