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

Anonymous’s picture

Status: Active » Closed (works as designed)
philipz’s picture

What 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.

shaisamuel’s picture

Status: Closed (works as designed) » Active

This 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)

catch’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Just 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.

mikostel’s picture

This issue is related to Views -- a patch has been posted here:

http://drupal.org/node/1959558

mikostel’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
justkristin’s picture

Terrible 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?

justkristin’s picture

Issue summary: View changes

EDIT
This is not a Core Issue. Turns out it had to do with either Flex Slider or Views. Solved.

Adamation’s picture

What was tje fox justkristen??

I'm getting this error message lots of times on lots of pages.

hefox’s picture

bdanin’s picture

this 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

osopolar’s picture

@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.