If I have a field in a node for a video file being handled by the JW player module and there has been no video uploaded for said field, I get the error:
warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /var/www/vhosts/sitename/httpdocs/sites/all/modules/jwplayermodule/integrations/int_filefield/jwfilefield.module on line 73.
I've displayed the content both as a "regular node" and as a query within a Panel and the results are the same.
I've seen other reports of this error happening because of PHP 5.3, but have not seen it mentioned in this forum (nor have I seen a real fix). Any suggestions on how to address this would be greatly appreciated!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1711478-3-fix_PHP_warnings_jwplayer_fields.patch | 2.49 KB | krisahil |
| #2 | 1711478_2.patch | 582 bytes | giorgosk |
Comments
Comment #1
HunterElliott commentedI should have also noted that when I used a query (View) to display the field, I did check the appropriate boxes so as to not display the field if it is empty (and tried it with those box values unchecked as well), but the error still displays.
Comment #2
giorgoskHere is a simple patch that fixes this for php 5.3
Comment #3
krisahil commentedHere's a more fleshed-out version that fixes the code in two places. I try to use filefield_content_is_empty() where reasonable.
Comment #4
krisahil commented