I get the following error when trying to create a map view:

warning: Invalid argument supplied for foreach() in /var/www/virtual/buildernet.co.za/htdocs/sites/all/modules/gmap/gmap_plugin_style_gmap.inc on line 172.

CommentFileSizeAuthor
#1 gmap_plugin_error.png155.09 KBkbk
#1 gmap_plugin_error.png155.09 KBkbk

Comments

kbk’s picture

Title: Views error » Getting same error
StatusFileSize
new155.09 KB
new155.09 KB

I'm seeing this error as well. Here's the code that is being referred to:

/sites/all/modules/gmap/gmap_plugin_style_gmap.inc on line 172

    $options = array();
    // @@@ Fix this when I'm not having a monday morning.
    // There's likely a more "correct" way.
    foreach ($this->display->display_options['fields'] as $id => $handler) {
      $data = views_fetch_data($handler['table']);
      $options[$id] = $handler['label'];
    }

I'm not advanced enough to know if it's a bug or if it's me. Generally, I assume it is me but...

More details:

Following this tutorial verbatim to create a gmap.

Drupal 6.14
Views 6.x-2.7
CCK 6.x-2.5
GMap Module 6.x-1.1-rc1
Location 6.x-3.1-rc1
Content Profile 6.x-1.0-beta4

The error occurs when creating a View. After specifying Relationships, Filters and Fields, I Add display > Page > Basic Settings > Style: GMap

See attached png.

Thanks in advance for any help and/or clarification.

kbk

kbk’s picture

Title: Getting same error » Invalid argument supplied for foreach() in /sites/all/modules/gmap/gmap_plugin_style_gmap.inc on line 172.

Look's like this is already being worked on:

http://drupal.org/node/371134

AlanAtLarge’s picture

Subscribe

kbk’s picture

Status: Active » Closed (duplicate)

Marking this as duplicate: #371134: warning: Invalid argument supplied for foreach()...gmap_plugin_style_gmap.inc on line 172.

For what it is worth, I think the solution to this problem (and others) is to work with the dev version (6.x-1.x-dev), not the rc.