Hello.

Testing the module behavior I checked that there were some bugs in the field validation process.

That bug can be reproduced in this way:
1.- Create a field and use the lat/lon or bounds widget.
2.- Create a node with any value for that field.
3.- Edit the node and delete the field content.
At this point, although the filed value has been removed, in the teaser, or node view, you will be able to see the previous value.

This bug is related to the hook_field_is_empty implementation, that only check if the 'wkt' value is empty to decide if the field is empty or not.

I have created a patch for this bug that also includes a way to show a form error when the value included in the field is not a valid geo value.

I hope that this patch will help to solve the bug, or at least, it could be a first approach to a better module implementation.

Congratulations for your module.

CommentFileSizeAuthor
geofield-validation.patch1.84 KBplopesc

Comments

Brandonian’s picture

Status: Active » Fixed

Thanks for the bug report and patch plopesc! I've committed a modified version of the patch.

Long term, we might need to revisit this issue, since the widget code itself looks like it might need some love/refactoring, but for the sake of a minimally viable product, this works well. Thanks again for the contribution.

plopesc’s picture

Hello
Thanks for taking into account my patch.
It was a first approach to try to fix a bug that was realy annoying for me.

Thanks for your great work with this module.

Best Regards

Status: Fixed » Closed (fixed)

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