Posted by johnv on February 24, 2013 at 11:18pm
5 followers
| Project: | GMap Module |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
| Issue tags: | Needs tests |
Issue Summary
I upgraded from v1.1. to v2.4, using Geofield (not Location). It seems Geofield support is lost.
The existing Gmap views and a newly created view do not show any maps, and also the following error:
"Notice: Undefined index: geofield in gmap_plugin_style_gmap->options_form() (line 376 of gmap_plugin_style_gmap.inc).
Comments
#1
Below correction makes the geofield-markers appear again.
(I'll post a proper patch once the 2.4 version is workin om my system)
<?phpelse if ($this->options['datasource'] == 'geofield') {
+ $geofield_name = 'field_' . $this->options['geofield'];
- $geofield_name = 'field_' . $this->options['markerfield'];
$geofield = isset($row->{$geofield_name}[0]['raw']) ? $row->{$geofield_name}[0]['raw'] : NULL;
if ($geofield) {
$lat = (float)$geofield[$lat_field];
$lon = (float)$geofield[$lon_field];
}
}
?>
#2
faster then expected, see attached patch.
#3
The last submitted patch, gmap_1926360_2_geofield.patch, failed testing.
#4
#2: gmap_1926360_2_geofield.patch queued for re-testing.
#5
looks like tests are old
possibly we should check with http://php.net/manual/en/function.array-key-exists.php for compatibility with legacy geofild versions?
#6
#2: gmap_1926360_2_geofield.patch queued for re-testing.
#7
Regarding #5, I do not know what you mean. Was there a change in the geofield definition?
The patch sets 2.4 back to 1.1, so apparently there was some reason in the first place to change it?
#8
the change was done in #1907478-4: Gmap gmap style views plugin using non-existing property geofield
looks like some kind off crossbug?
#9
2 #7
my proposal is to code some kind of array key checking before assigning data to
$geofield_namefor avabiality of field data#10
I added a comment in #1907478-10: Gmap gmap style views plugin using non-existing property geofield
#11
looks like Your path from #2 good despite proposed #1907478: Gmap gmap style views plugin using non-existing property geofield due to
<?phpelse if ($this->options['datasource'] == 'geofield') {
$geofield_name = 'field_' . $this->options['geofield'];
?>
if geofield - use geofiled )))
#12
as for me - this workaround needs tests for better checking
#13
ja, there are 2 parts "if ($this->options['datasource']" in render().
They can be merged, so the 2nd part can be just :
$lat = (float)$row->{$lat_field};$lon = (float)$row->{$lon_field};
#14
#2: gmap_1926360_2_geofield.patch queued for re-testing.
#15
#13 Can You reproduce a bug with tests?
FYI Look at the http://drupalcode.org/project/gmap.git/blob/HEAD:/tests/gmap.test as example
#16
OK, thisis resolved, now that #1907478: Gmap gmap style views plugin using non-existing property geofield is reversed.