Closed (fixed)
Project:
Geofield
Version:
7.x-1.0
Component:
User interface
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2011 at 08:54 UTC
Updated:
15 Jun 2012 at 17:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
John_NL commentedThis problem can be fairly easily solved. The reason for failing is that the hook-function geofield_field_widget_form is not called after validation errors. As the rendering of openlayers maps depend on a couple of javascripts that are loaded through this function we need to call the necessary functions from #build_after (which calls a function on every render).
As I don't have good testing facilities (nor time), code is presented as "works for me".
Changes in the attached file are marked "20111005JZ"
HTH
John
Comment #2
phayes commentedI think this has been fixed - at least I can' reproduce it. We've pretty seriously refactored the widget - so its not surprising. If you can reproduce this using the latest versions, please re-open.
Comment #3
bruvers commentedI'm using version 7.x-1.0. If an form validation error occurs the map isn't displayed. No JS or CSS files related to Geofield or OpenLayers are loaded after form validation. The only way for a user to get around this is to start filling out the form from scratch and hope to get it all right this time.
Comment #4
Brandonian commentedI've made some commits based on @John_NL's code to address this issue.
- 7.x-1.x: http://drupalcode.org/project/geofield.git/commit/1978a0f
- 7.x-2.x: http://drupalcode.org/project/geofield.git/commit/351262c