Hi all,

I added a geofield field to my profile 2 type and created a new user. The openlayers selected location is not saved by the system. Here are the steps to reproduce:

  1. Drupal 7 clean install and download and enable this modules: Openlayers 7.x-2.0-beta1+84-dev, Geofield 7.x-2.0-alpha1+9-dev, Geophp 7.x-1.7, Libraries for the Openlayers 2.12 js
  2. Create a content type and add a geofield with Openlayers widget
  3. Create a test user and add click on the map (The marker is set and the hidden inputs are populated)
  4. Save and nothing happends

Not sure if there is a module missing but can't make it to work

Regards,

Julian Mancera

CommentFileSizeAuthor
#10 geofield-1834972-10.patch570 bytesAnonymous (not verified)

Comments

phayes’s picture

Status: Active » Fixed

I think this might be fixed now. Marking it as such. Can you test with the latest dev and let us know? If it's still not fixed please re-open.

Status: Fixed » Closed (fixed)

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

balagan’s picture

I am using 7.x-2.0-alpha2+6-dev version, and I have this problem. When saving the content type with openlayers widget, I see
<input class="geofield_wkt" type="hidden" name="field_wptgeofield[und][0][geom]" value="POINT(2.329101522979369 8.054395058755233)">

When saving the node, geometry data is not saved, the $node object in hook_node_presave() contains empty field_wptgeofield[und] array. I am suspicious of the input handler expecting old geofield structure?

balagan’s picture

Well, openlayers_geofield_widget_element_validate() validates it nicely... Will debug more later.

balagan’s picture

The node_form_submit gets field_wptgeofield[und][0] with the value. The [geom] dimension is missing!

balagan’s picture

Status: Closed (fixed) » Active
balagan’s picture

It works when I change line 417 in geofield.widgets.openlayers.inc to:

form_set_value($element['geom'], $geom->out('wkt'), $form_state);

I think line 405 should be changed too.

gigabates’s picture

#7 works for me too.

Robin_K’s picture

Yup, the fix from #7 works for me too

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new570 bytes

I tried #7 as well, it looks like it solves the problem when using single point entries. Since the issue is marked critical I rolled this as a patch and I'm marking this as "needs review".

Please review this patch! When done reviewing it, make a comment if it works (or if not!). If someone could test the "collections" to see if line 405 needs an update that would be great.

Once we have some reviews someone (who is not me) can then mark this to be RTBC... unless the module maintainers want to jump in and fast-track this one.

rballou’s picture

#10 works for me. Thanks for the patch

primerg’s picture

Doesn't work for me

  • I'm using Openlayers 2.13 and the latest 2.x-dev
  • In the field settings, Storage Options: Store each simple feature as a separate field.
  • Applied the patch in #10
  • I create a new node with the geofield
  • Click the save button.
  • It refreshes to the same page. No node created.
Brandonian’s picture

Status: Needs review » Fixed

I can't replicate this issue with the current dev version of Geofield. I did recently apply a patch that affects Openlayers integration. See #1963242: Openlayers + Geocoder hides Openlayers widget. Please reopen if symptoms continue.

Status: Fixed » Closed (fixed)

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