Invalid argument supplied for foreach() line 54

kleinmp - October 29, 2009 - 17:44
Project:Location
Version:6.x-3.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

location_map_link_us

warning: Invalid argument supplied for foreach() in /path/to/drupal/sites/all/modules/location/location.inc on line 54.

The code looks like this:

$selected_providers = variable_get('location_map_link_'. $location['country'], function_exists($default_func) ? $default_func() : array());

$links = array();
foreach ($selected_providers as $mapper) {

On my site, it's looking for the variable location_map_link_us, but that variable contains a string instead of an array, so I'm getting the above error.

#1

kleinmp - November 4, 2009 - 15:17
Status:active» fixed

Scratch this. Somehow the variable 'location_map_link_us' was stored as a string instead of an array. I'm not sure how that happened, but everything is fixed now.

#2

System Message - November 18, 2009 - 15:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.