Download & Extend

Invalid argument supplied for foreach() line 54

Project:Location
Version:6.x-3.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

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

Status:fixed» closed (fixed)

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

nobody click here