Markers disappears after submission.

Tomkun - December 13, 2007 - 03:18
Project:cck_map
Version:5.x-3.3
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:needs review
Description

When I add a marker to the map, the marker appears correctly, however it does not appear after submission.
The map retains the location and zoom information, but the marker is no longer visible.

#1

B747 - December 16, 2007 - 19:29

I get this too...

#2

slysie - December 30, 2007 - 20:56
Title:Markers disappear after submission.» Markers disappears after submission.

I get this too, there is a JS error 'field_location' not found

#3

blueflowers - February 2, 2008 - 17:32

I'm getting this as well.

#4

yngvewb - March 7, 2008 - 22:45

I also got this error. Have someone found a solution?

#5

tiptoes - March 13, 2008 - 12:33

I believe this has come down to a browser issue? Are you all getting this error in IE only? Does it work in Firefox?

#6

darrenmUK - March 15, 2008 - 13:26

i get this too. on firefox 3 beta 3

#7

setvik - June 3, 2008 - 09:20

I'm getting the same behavior in Safari 3, ie6 and ie7.

Works fine in Firefox 2 and 3rc1.

I'm using cck_map 3.3

#8

setvik - June 4, 2008 - 03:55
Version:5.x-3.2-1» 5.x-3.3
Component:User interface» Code
Priority:normal» critical
Status:active» needs review

Ok, I think I tracked down the bug.

It happens if you put any spaces or underscores (the same thing really, as spaces are automatically replaced with underscores) in the name for any cck map fields you create.

HOW TO REPRODUCE:
1) Create a new cck field (with at least one space or underscore in the name: e.g. "my map", which will become "field_my_map") & attach it to a content type.

2) Use Safari 3 (probably 2 as well though i haven't tested), IE6, or IE7 and create a new node, click on the map to set a marker, and save the node.

3) view the node; the marker should no longer be set (and if you edit the node, same thing).

WHY IT'S HAPPENING:

There's some buggy string replace code in the javascript that incorrectly names the form fields for the marker points latitude and longitude.

It's supposed to replace all dashes with underscores, but only works in firefox... In other browsers, it only replaces the first dash, failing for any field with more than one underscore in the name

e.g. a cck field named "field_my_map" results in lat & lon fields whose name incorrectly starts with "field_my-map" in IE6, IE7, and Safari 3.

Attached is a patch that fixes the string replace code.

AttachmentSize
cck_map_js_replace.patch 557 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.