Recently installed fresh D7 install with Gmap, Location and cck.

After creating a location submission page using cck I get this error every time i try and submit a location.

I am new to drupal and am stumped by this error if anyone knows how to fix it or is it a bug with the location module?

Thanks.

Error=

Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /websites/123reg/LinuxPackage21/ma/pm/yp/mapmyphoto.co.uk/public_html/photo/sites/all/modules/location/contrib/location_search/location_search.module on line 328 and defined in db_query() (line 2213 of /websites/123reg/LinuxPackage21/ma/pm/yp/mapmyphoto.co.uk/public_html/photo/includes/database/database.inc).

Comments

mattbk’s picture

I am seeing the same error when adding a location to a user.
Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /var/www/nodakpaleo/sites/all/modules/location/supported/location.us.inc on line 61 and defined in db_query() (line 2213 of /var/www/nodakpaleo/includes/database/database.inc).

Using Feb 2 build and these fields:
Location name
Street
Additional
City
State/Province
Postal code
Country
Phone number

rooby’s picture

Status: Fixed » Closed (fixed)

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

jbova’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new7.64 KB

This bug doesn't seem to be fixed in the latest 7.x-4.x version. I checked the commits, and made sure my files were up to date. However, it can be fixed by updating the parameters passed to db_query to those expected in the D7 version of this function. I have attached a patch. It seems to be working fine in the latest version after applying this patch.

The same needs to be done in the following contrib modules: location_cck and location_taxonomy.
This also affects the location_update_* functions in location.install file as well as the following files in the tests directory:
location_testcase.php
cow.test
location_cck.test

muschpusch’s picture

Status: Needs review » Reviewed & tested by the community

Hey jbova, patch looks good and i can confirm that it fixes the issue! Thanks a lot!

ankur’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Committed to 7.x-4.x.

Thanks for the patch.

I'd also like to take this chance to remind everyone that the 7.x-4.x branch is still incomplete and under development. Anyone trying to run a D7 production site with the location module should be using the 7.x-3.x branch.

The 7.x-4.x branch is a work-in-progress that is currently not supported, though patches are always welcome.