Hello,

I've been getting this error on my sites lately, and I'm stumped as to what may be causing it. Does anyone have any ideas what I may be doing wrong?

array_search() [<a href='function.array-search'>function.array-search</a>]: Wrong datatype for second argument in /var/clients/client0/web2/web/sites/all/modules/jquery_update/jquery_update.module on line 40.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcelboere’s picture

For me this error occurred when selecting development compression level in /admin/settings/jquery_update

Choose jQuery compression level:
Production (Minified)
Development (Uncompressed Code)

So I switched back to Production

georgedamonkey’s picture

For me, I had it on Production all ready. So, it's still giving that error.

tonyhrx’s picture

Yep Im getting this error too

ccshannon’s picture

I just installed jQuery Update on a fresh 6.15 site and I'm getting this error as well.

Anonymous’s picture

Assigned: Unassigned »

I am also getting this error sporadically, and can't for the life of me fix it. If it gets solved PLEASE POST!

Lol, thanks.

ccshannon’s picture

PLEASE IGNORE THIS PATCH. IT HAS AN ERROR AND I CANNOT REMOVE THE POST.

Thanks!

ccshannon’s picture

Sorry about that. Try this patch. This should remove the error. Apparently, PHP array_search function is being run on an object that is supposed to be an array, but many times is not. This patch checks the array to make sure it has elements in it, before running the array_search function.

This is against 6.x-2.x-dev

Run this patch from within the jquery_update/ folder

georgedamonkey’s picture

I can confirm the patch worked beautifully for me. I've got a multi-site setup with about 10 sites and it worked perfectly for all of them.

Thank you!!

mfer’s picture

Status: Active » Fixed

I committed a slightly modified version. Nice catch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.