Hy,
I am getting the following error while accessing the location-geocoding settings admin/settings/location/geocoding

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/guitarf/public_html/sites/all/modules/location/location.module on line 438.

Geocoding isn't working...
I'll try to figure it out, if someone finds a solution, I will be thankfull to hear it :)

Tom

Comments

twom’s picture

I did a quick fix by manually including the geocoding/google.inc file

foreach (variable_get('location_general_geocoders_in_use', array()) as $geocoder) {
include_once LOCATION_PATH. '/geocoding/'. $geocoder .'.inc';
}

to just
include_once LOCATION_PATH. '/geocoding/google.inc';

ankur’s picture

Title: rong datatype for second argument in location.module on line 438 » Wrong datatype for second argument in location.module on line 438

Hey Tom,

I tried to run some debug statements to see if the file was actually not getting loaded and if the array was actually NULL. I couldn't find anything wrong. Could you post back with the revision numbers you have at the top of each file for google.inc, location.module, and location.inc?

-Ankur

twom’s picture

Hey Ankur,

these are the versions I use

// $Id: location.module,v 1.79.2.10 2007/08/02 01:57:25 ankur Exp $
// $Id: location.inc,v 1.45.2.7 2007/08/02 01:57:25 ankur Exp $
// $Id: google.inc,v 1.1.2.3 2007/08/02 05:28:08 ankur Exp $

regards,
Tom

ankur’s picture

I found the bug after taking another look at it. Apparently, the google.inc file never gets loaded if it hasn't been enabled to geocode for any country, which is a catch if that's what you're trying to do. I originally couldn't replicate the bug because I already had it enabled and later changed the code to not hard-code the loading of the google.inc file.

Anywyay, I've committed a fix. You can either run CVS update if you have a checkout of the DRUPAL-5 branch or you can just wait until the tarball gets automatically generated again.

-Ankur

ankur’s picture

Status: Active » Fixed
twom’s picture

thx :)

Anonymous’s picture

Status: Fixed » Closed (fixed)
mxt’s picture

Version: 5.x-1.x-dev » 6.x-3.1
Status: Closed (fixed) » Active

Ops, I get the same error with last version (6.x-3.1) I've just installed:

warning: in_array(): Wrong datatype for second argument in /var/www/mysite.com/sites/all/modules/contrib/location/location.admin.inc on line 215.

How can this be fixed?

Thank you very much

mxt’s picture

mmmm... I think I've understand the problem: the file google.inc downloaded via DRUSH is EMPTY!!!!!

I'll try now to sobstitute it with the one downloaded directly from module page (no drush)

MXT

mxt’s picture

Yes now it works: how it can be occurred?

legolasbo’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing old D6 issues as D6 is end of life