My dblogs are showing many rows of this this error constantly (several times per hour):

Warning: array_key_exists() expects parameter 2 to be array, null given in theme_image_formatter() (line 605 of /path-to-drupal/modules/image/image.field.inc).

The only issue I could find for it was posted for Drupal core -- http://drupal.org/node/1902444 -- but it was quickly dismissed as being a Views issue instead. However, there is no indication how to fix it, and I haven't found any issues in Views about it.

Does anyone know what to do about this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BAHbKA’s picture

Here's a quick patch for this issue.

mikostel’s picture

The above patch worked like a charm. Thanks BAHbKA!

merlinofchaos’s picture

Status: Active » Needs review

Setting proper status in the hopes that the right one will get someone to review it.

Status: Needs review » Needs work

The last submitted patch, fixed_image_warnings-1959558-1.patch, failed testing.

jfurfey’s picture

Any thoughts on whether the patch is safe to use in production sites? I realize it failed testing for official integration....

BAHbKA’s picture

Status: Needs work » Needs review
davidneedham’s picture

This patch didn't fix the issue for me, but I think it may be a bigger issue than views. I see the exact error described when looking at a view, but none of the images load when viewing a node either. It looks like the src="myfoowebsite.com/" - which obviously isn't going to get too far. Is anyone else seeing that?

milekium’s picture

This patch didn't fix the issue for me, What I found to be the problem is to have an image fields in the view whose images files are not in the folder (sites/files..) where is suppose they should be; or having and image field linking to no image files. I guess when views try to render the image, which does not exist as a file in the folder but it does exists as a field, generates this error. placing back the images files fix the error.

Summit’s picture

Status: Needs review » Reviewed & tested by the community

Hi,
This patch did remove the error, if something else is wrong this is not related to the patch I think, so please commit.
Greetings, Martijn

RKopacz’s picture

I just applied this patch in response to getting the same error. It is still displaying the error. Does anybody have any other ideas?

I was just getting ready to go live with a newly upgraded-from-6 site. A bit of additional info, all was working fine until I upgraded my local dev environment to php 5.3.8. It was in 5.2.x before then. Not sure if that makes a difference.

MaWebDesigns’s picture

Maybe I'm just dumb, but I am trying to manually patch this - but I can't find the file: /modules/field/views_handler_field_field.inc anywhere in my site.

I found the modules/field folder - but not the views_handler_field_field.inc file. Any suggestions?

I have to manually do patches due to my server setup (no terminal access, and we are currently looking to change hosting providers).

Thanks in advance.

UPDATE: Never Mind - found it. However, the patch did not fix my issue. The only workaround I had was to specify an image for the product/element that was the cause of the error (i.e. image could not be NULL).

Thanks

davidneedham’s picture

Hey @MaWebDesigns: it's a common mistake, but patches usually start at the root of the module it's patching. And (rather confusingly) Views contains a folder called "modules". So what you should be looking for is sites/all/modules/views/modules/field/views_handler_field_field.inc. Hope that helps!

MaWebDesigns’s picture

Thanks Dave, as soon as I posted this - I found the file and updated.

Unfortunately, it still didn't fix the errors.

RKopacz’s picture

For what it's worth, I saw this error after an upgrade from 6 to 7. Also, I found that it goes away when using fields, but appears when using view modes, after the patch is applied.

justkristin’s picture

Patch didn't fix things for me, either.

justkristin’s picture

Status: Reviewed & tested by the community » Needs work

Changing status in hopes that another solution might be searched for...

DHL’s picture

Are you guys have this error message shows at the front end pages ?
For my website, this error message only show at back end configure page.
*I didn't try this patch yet.

Horroshow’s picture

The patch works also with v3.7

suffering drupal’s picture

I didn't have this error at first, then I activated language support for Article type content and it suddenly appeared. On deactivating language support after updating some first Articles from English to Spanish I though it would disappear again. However instead now I have it 7 times on ALL pages AND to see for Anonymous visitors, great!
Since I just have decided to include a Drupal Error & Struggle blog on all websites, you will now be able to follow all my struggles and frustrations on each of the never ever finished (never more than say 60%) Drupal sites, starting with http://visitaramsterdam.info/blog

As you can see there, the above changes were only to find a way out of even an earlier problem. Instead, problems got more and worse.
In fact I just discover that now pictures have disappeared from the carrousel at the bottom...

Anyway, for the short "solution" how can I at least avoid them to appear on visitors pages?

hefox’s picture

kamenrs’s picture

The patch worked for me perfectly.
Thanks a lot!

ennetws’s picture

The patch works, thanks.

mstrelan’s picture

kengilb’s picture

Rerolled #1 against 7.x-3.21.

devad’s picture

I have applied patch #24 manualy to 7.x-3.24 and it did fix my log errors.

The patch needs reroll though... so not marking it as RTBC.

DamienMcKenna’s picture

Status: Needs work » Needs review
DamienMcKenna’s picture

Version: 7.x-3.6 » 7.x-3.x-dev
DamienMcKenna’s picture

Issue tags: +Needs tests

Could someone please explain how to reproduce this error? I'd like to add some test coverage to make sure it works correctly and doesn't break again. Thank you.

DamienMcKenna’s picture

Status: Needs review » Needs work
2pha’s picture