Hi,
I have a problem.
I modified the location\supported\location.it in order to pick in the autocomplete forms the city names instead of province names.
a sample of the new file is below:
<?php
// $Id: location.it.inc,v 1.7 2008/02/04 02:05:32 bdragon Exp $
// Italy
function location_province_list_it() {
return array(
'Agli' => "Agli",
'Airasca' => "Airasca",
'Ala di Stura' => "Ala di Stura",
'Albiano dIvrea' => "Albiano dIvrea",
'Alice Superiore' => "Alice Superiore",
'Almese' => "Almese",
'Alpette' => "Alpette",
'Alpignano' => "Alpignano",
'Andezeno' => "Andezeno",
'Andrate' => "Andrate",
'Angrogna' => "Angrogna",
....
);
}
the autocomplete functionality is working after this modification.
But when I create a new node I get the following error message and the node is not displayed on the map (0-0 coordinates).
preg_match() expects parameter 2 to be string, array given in C:\...\includes\bootstrap.inc on line 679.
Please can someone put me in the right direction?
Thanks
Comments
Comment #1
robomalo commentedThis happens to me in sites I work on in Drupal 5 and 6, both because of the location module. It is because of a function in bootstrap.inc that expects $text to be a string. In my cases it's because the lat and long are floats rather than strings.
Comment #2
EgonO commented+1 subscribing. same here with drupal 5.11 and location 5.x-3.0-rc1
Comment #3
olav commentedFor me, the error occurs in Drupal 6.5 and location-6.x-3.0-rc1.tar.gz when I save a node with location information. Backtracing the error in bootstrap.inc leads to line 18 in location.token.inc
In my case, $object->location is
The problem is that locpick is an array which check_plain() does not handle. The attached patch check for an array and loops over the array fields.
Comment #4
carlogen commentedHi Olav,
I checked your patch.
In my case, it fix the error, but the token does not work anymore.
I am using an autonode title with token [location-province_name_N], and it does not give back the province name.
I checked [location-province_N] and it works.
Comment #5
bdragon commentedDuplicate of #317998: preg_match() expects parameter 2 to be string, array given w pliku /mydrupaldir/includes/bootstrap.inc, linia 670..