On the top of the settings/gmaps page i get this error.
warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\modules\gmaps\gmaps.module on line 1653.
this line is :
//apply translations
foreach($units as $key => $info) {
warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\modules\gmaps\includes\gmaps.admin.inc on line 798.
this line is :
foreach(gmaps_length_get_units() as $key => $info) {
Also if I try to edit any of the map presets I get this error message:
warning: Parameter 2 to gmaps_map_form() expected to be a reference, value given in C:\xampp\htdocs\includes\form.inc on line 372
this line is:
$form = call_user_func_array(isset($callback) ? $callback : $form_id, $args);
By the looks of this, it seems that $key is not being correctly called. However i've double checked the API key, and ive tried using Keys module to see if that makes a different.
I had Gmap module installed when i installed Gmaps tools, but have since deleted and reinstalled everything, could this be causing an effect?
Could there be something in the SQL database causing this?
Also, im running an offline server, can this cause this malfuntion?
Comments
Comment #1
xmarket commentedWell, the first belongs to length units not to the API key. For some reason, it seems there are no length units on your instance, which is very strange, because there are two hardcoded (meter and foot). If you changed anything to the resources/length.units.info file, then it can cause the error. In this case you should fix the file or revert the changes, then clear your caches before you visit the settings page.
The second (parameter 2...) is strange, too, because it can occur only, when you try to add a new preset.
Comment #2
volocuga commentedGetting same as "warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\modules\gmaps\gmaps.module on line 1653." upon installation Gmaps 6.2 dev
Comment #3
xmarket commentedDo you use any cache related modules?
Comment #4
astro87 commentedI have the same "warning: Invalid argument supplied for foreach() in C:\strony_www\PHP\xampp\htdocs\drupal-6.16\modules\gmaps\gmaps.module on line 1653"
if this is important I install gmaps after installing gmap module which also not work properly.
Comment #5
xmarket commentedhttp://drupal.org/cvs?commit=375312
Comment #6
wrd commentedI'm still getting this error in 6.x-2.1. The dev release generates the same error, but on line 1655.
Comment #8
Harald.Winzer commentedHello,
I also get the problem.
warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\test\sites\all\modules\gmaps\gmaps.module on line 1655.
Help, please
Comment #9
Harald.Winzer commentedreopening
Comment #10
sourabh.iitm commentedI installed version 6.x 2.1 and i was getting the error for C:\xampp\htdocs\modules\gmaps\gmaps.module on line 1653
So i updated it to 6.x 2.x (11 July) So my error changed to C:\xampp\htdocs\modules\gmaps\gmaps.module on line 1655.
Something to do with xampp?
Comment #11
CardEra commentedAlso getting the same error - but is probably some issue with either my XAMPP version or module incomaptibility.
I installed on another machine with fewer modules and it worked fine.
Anyone have any ideas - I'll start removing modules to see what works...
Comment #12
ES.Bill commentedAlso having the same error. I've installed on two other machines in the past using XAMPP , one with quite a number of modules installed without any problems. I've kept the two machines up to date with no problems, but with a new install started getting errors.
I'm starting to do comparisons and uninstalling modules to also see what works.
Comment #13
ES.Bill commentedAfter uninstalling a large number of modules with no change in warnings I upgraded from XAMPP 1.7.2 to 1.7.3 with no change. I then went back to XAMPP 1.7.1 and warnings disappeared. Have reloaded modules and everything looks fine. Looks like a version problem with Apache or PHP.
Comment #14
xmarket commentedIt looks like a PHP incompatibility. Can you post the PHP versions where the problem occurs?
Comment #15
sean-gnu commentedCommenting out the caching code and clearing the drupal cache a few times seems to fix this :
from line 1644 of gmaps.module :
/*if no reset required, then try to use cached content
if (!$reset && ($cached = cache_get('gmaps_length_units', 'cache'))) {
$units = $cached->data;
}
else {*/
$units = _gmaps_call_func('gmaps', 'admin', '_gmaps_length_get_units');
/* } */