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).
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | argument-2-passed-to-db_query-1048584-0.patch | 7.64 KB | jbova |
Comments
Comment #1
mattbk commentedI 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
Comment #2
rooby commentedFix committed to 7.x-3.x and 7.x-4.x.
http://drupalcode.org/project/location.git/commit/3f284c8
http://drupalcode.org/project/location.git/commit/7a79c18
Comment #4
jbova commentedThis 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
Comment #5
muschpusch commentedHey jbova, patch looks good and i can confirm that it fixes the issue! Thanks a lot!
Comment #6
ankur commentedCommitted 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.