Hi there. Thanks for all your work on this incredible module! I've noticed a little bug, though. The geocoder is working brilliantly when I'm in the node add/edit form, however if I submit the form with errors in it (e.g. missing a required field, or anything else that throws up a validation error), the autocomplete box doesn't work. The only way to then enter a location is to use the pencil icon on the map and click within it. As I have location as a required field, this is very confusing to my end-users.

Does anyone have any ideas as to how we can get around this?

Thanks.

Comments

LGLC’s picture

Title: Geocoder autocomplete doesn't work once node form has been submitted without requried fields » Geocoder autocomplete doesn't work once node form fails validation
Yanxi’s picture

I am having this problem as well. The theme of the autocomplete suggestion list even changed when there was a validation error, and it doesn't auto fill the other cck text fields any more either. Any advice for a fix?

Yanxi’s picture

I found out that the problem was causing by arrange_fields module. It looks like all the fields are wrapped into arrange_fields module's container which might be the cause. Disabling it solved my problem.

LGLC’s picture

Thanks for your reply Yanxi. I'm glad you got it sorted your end! I didn't have arrange_fields installed when doing this. though I did add in two Markup fields above the geocoder field - not sure if that would make any difference or not (they didn't wrap it, but were just above it). Unfortunately, the repeated errors meant I had to move to using the Location module. I'd still be interested in a fix, as I much prefer the OpenLayers Geocoder interface!

muhleder’s picture

Status: Active » Needs review
StatusFileSize
new1.02 KB

Seeing this as well. The problem seems to be that the js is not being included if the form fails validation.

By adding an after build function instead of directly adding the js we can ensure that the the js is added in the after build (which is called after validation).

francewhoa’s picture

The problem seems to be that the js is not being included if the form fails validation.

Confirming this issue. Here is the missing .js file if the form fails validation [...]/modules/openlayers_geocoder/js/openlayers_geocoder.js?z"></script>

This issue is present in both openlayers_geocoder versions:
* 6.x-2.x-dev (2011-Apr-28 )
* 6.x-2.0-alpha5

Thanks muhleder :) I'll try to test the patch then post result here.

francewhoa’s picture

Status: Needs review » Reviewed & tested by the community

Confirming patch in comment #5 works

Thanks muhleder :)

francewhoa’s picture

StatusFileSize
new21.54 KB

Attaching module with patch in comment #5 already applied. For testing only. Do not use on live sites.

Patch applied to openlayers_geocoder 6.x-2.x-dev (2011-Apr-28)

steinmb’s picture

Priority: Normal » Major

If this is RTBC, why is it not commited?

muhleder’s picture

Priority: Major » Normal

@steinmb Perhaps the maintainer hasn't had time to review yet? Or perhaps waiting for more people to confirm the fix works for them?

Resetting status to normal, don't think this qualifies as a major as the geocoder will still work most of the time.

steinmb’s picture

This patch no longer apply. Rerolling and testing. Still works and fixes the issue.

Have tried DM the maintainer to get hold of the maintainer of this module, since no patches are getting commited. Offered to become comaintainer to help out but sadly never got an answer.

steinmb’s picture

Status: Reviewed & tested by the community » Fixed

Got commit access and went ahead and committed #5 by @muhleder.
Pls. ignore patch rolled in #11.

Commit: http://drupalcode.org/project/openlayers_geocoder.git/commit/70a9559

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.