Fatal error: Cannot access empty property in C:\wamp\www\drupal6\sites\all\modules\gmap\gmap_plugin_style_gmap.inc on line 188

I found another issue with the same message but different location, so I'm opening a new issue.

I am trying to map all nodes of a specific type, which has Location information, although I can't guarantee that it is complete for all nodes.

Drupal 6.20
Views 6.x-2.12
Gmap 6.x-1.1
Location 6.x-3.1
PHP 5.2.5
MySql 5.5.8

Comments

NancyDru’s picture

I added a filter for a single node, which does have complete information, and it still fails.

NancyDru’s picture

It appears that $tooltip_field is empty, so the $row->$tooltip_field cannot be handled. Here's the first part of $this:

 gmap_plugin_style_gmap Object
(
    [options] => Array
        (
            [grouping] => 
            [macro] => [gmap ]
            [datasource] => location
            [markers] => static
            [markertype] => drupal
            [latfield] => 
            [lonfield] => 
            [markerfield] => 
            [center_on_nodearg] => 0
            [center_on_nodearg_arg] => 
            [highlight_nodearg] => 0
            [highlight_nodearg_arg] => 
            [highlight_nodearg_color] => #FF0000
            [tooltipenabled] => 1
            [tooltipfield] => 
        )

    [definition] => Array
        (
            [title] => GMap
            [help] => Displays rows as a map.
            [handler] => gmap_plugin_style_gmap
            [theme] => gmap_view_gmap
            [uses row plugin] => 1
            [uses grouping] => 1
            [uses options] => 1
            [type] => normal
            [module] => gmap
            [theme path] => sites/all/modules/gmap
            [theme file] => gmap.views.inc
            [path] => sites/all/modules/gmap
            [file] => gmap_plugin_style_gmap.inc
            [parent] => parent
        )
NancyDru’s picture

In function render(), I added one if statement:

    $tooltip_field = '';
    if ($this->options['tooltipenabled']) {
      $tooltip_field_obj = $this->view->display_handler->get_handler('field', $this->options['tooltipfield']);
      $tooltip_field = $tooltip_field_obj->field_alias;
    }
    if (empty($tooltip_field)) {
      $this->options['tooltipenabled'] = FALSE;
    }

I still have some other problems, but they go to other issues.

liminu’s picture

Same problem, fix #3 works correctly.