Hi,

After upgrade test3 -> rc1 I've found lot of these errors in watchdog reports:

preg_match() expects parameter 2 to be string, array given w pliku /mydrupaldir/includes/bootstrap.inc, linia 670.

GMap RC1 works fine.

Szy.

Comments

szy’s picture

(Drupal 5.10,
GMap 5.x-1.0-rc1,
Location 5.x-3.0-test3 -> rc1,
PHP 5.2.0-8+etch11,
MySQL 5.0.32)

Szy.

bdragon’s picture

Assigned: Unassigned » bdragon

Looking into it.

bdragon’s picture

I'm pretty sure something is calling check_plain() on an array.

It's easier to debug if you install xdebug and get a backtrace, by the way ;)

mburak’s picture

I think it's in the location.token.inc file. I'm having a similar error when submitting a node.
The part of the code calling the check_plain() is here:

foreach ($location as $field => $value) {
    $values["location-{$field}_{$key}"] = check_plain($value);
}

I wrapped the $values... line with a if(!is_array($value)){ but i don't know if it's the best way.

bdragon’s picture

That was one of the points I was suspecting, seeing as there was some mention in pathauto about the error.

Could you check what fields are causing the problem?

Something like

if (is_array($value)) {
  watchdog('debug', t('Bad token -- %key', array('%key' => $key)));
}

followed by checking admin/reports/dblog should do the trick...

mburak’s picture

It seems that the field is locpick.

bdragon’s picture

Oh, of course... That makes sense.

I went ahead and added the if (!is_array()) check.

http://drupal.org/cvs?commit=144994
http://drupal.org/cvs?commit=144996

szy’s picture

Status: Active » Fixed

Thanks, now it works fine.

And thank you for all your work :]

Szy.

bdragon’s picture

bneel’s picture

Ok it's working. Thanks again bdragon

eliosh’s picture

I confirm that mburak comment #4 works perfectly.

bdragon’s picture

I just rolled rc2 mainly because of people running into this.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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