I've created a block view using a contextual filter with a default value type of Content ID from URL. This view shows an image. If I do not upload an image in the image field for this content type, I get the following message on the node page.
Warning: array_key_exists() expects parameter 2 to be array, null given in theme_image_formatter() (line 605 of /var/www/vhosts/www.myurl.com/httpdocs/modules/image/image.field.inc).
The block also appears with a broken image inside it, even though I did not upload one.
EDIT
This is not a Core Issue. Turns out it had to do with either Flex Slider or Views. Solved.
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
philipz CreditAttribution: philipz commentedWhat did you do to solve it? I'm having the same error.
EDIT: Never mind it was not a slideshow in my case but a product field of a node displayed in a view below the slideshow. The image was missing/corrupted.
Comment #3
shaisamuel CreditAttribution: shaisamuel commentedThis is a core issue (modules/image), and its a common one for many sites. Just follow the link and you will see that there are many pages of many website with this error.
I was working with media 2.x when this first show up.
Warning: array_key_exists() expects parameter 2 to be array, null given in theme_image_formatter() (line 605 of modules/image/image.field.inc)
Comment #4
catchJust because the PHP error is from a core function doesn't mean the bug is actually in core.
This needs steps to reproduce, ideally starting with a clean Drupal 7 install.
Comment #5
mikostel CreditAttribution: mikostel commentedThis issue is related to Views -- a patch has been posted here:
http://drupal.org/node/1959558
Comment #6
mikostel CreditAttribution: mikostel commentedComment #7
justkristin CreditAttribution: justkristin commentedTerrible to point this out, perhaps, but for those of us who cannot open up a module or core and easily find and patch issues, searching on the error is the best we have. When I search this one (out of need, unfortunately), there are two-ish entries on here (the patch in one not working for me), and pages and pages of sites actually sporting the error like a fashion statement. Is there any other possible solution?
Comment #7.0
justkristin CreditAttribution: justkristin commentedEDIT
This is not a Core Issue. Turns out it had to do with either Flex Slider or Views. Solved.
Comment #8
Adamation CreditAttribution: Adamation commentedWhat was tje fox justkristen??
I'm getting this error message lots of times on lots of pages.
Comment #9
hefox CreditAttribution: hefox commented#920840: Broken images displayed and PHP notices when file/image field values are missing for possible core issue
Comment #10
bdanin CreditAttribution: bdanin commentedthis can also happen when you print fields (as variables) in a template file (like a field|node|page.tpl.php template), but then those fields are empty on a node
make sure you wrap the variables in
<?php if(isset($node) && $node->field_name):
, as outlined here:https://www.drupal.org/node/1056564#comment-6349558
Comment #11
osopolar@hefox or @justkristin: couldn't find the Flex Slider issue you mentioned in the summary/in #7.0, does this issue already exist?
Wondering why status was set to fixed.