Download & Extend

Markers disappears after submission.

Project:cck_map
Version:5.x-3.3
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:needs review

Issue Summary

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.

Comments

#1

I get this too...

#2

Title:Markers disappear after submission.» Markers disappears after submission.

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

#3

I'm getting this as well.

#4

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

#5

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

i get this too. on firefox 3 beta 3

#7

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

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
nobody click here