Closed (fixed)
Project:
GeoNames
Version:
5.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2008 at 04:15 UTC
Updated:
28 Dec 2008 at 20:32 UTC
I've been seeing pairs of messages like this for weeks in my watchdog logs
"Invalid argument supplied for foreach() in /var/www/folkjam/html/includes/common.inc on line 752."
"strtr() [function.strtr]: The second argument is not an array in /var/www/folkjam/html/includes/common.inc on line 767."
I added some code to t() in common.inc to tell me a little more, and tracked the problem down to this call to drupal_set_message() within GeoNames
if (empty($data)) {
drupal_set_message(t('Fetching data from GeoNames failed... please try again later.', 'error'));
return FALSE;
}
The 'error' argument is intended for drupal_set_message(), but is accidentally getting passed as the second parameter to t(), which is supposed to be an array of replacements.
Comments
Comment #1
lyricnz commentedFixed in D5, D6 and HEAD CVS.