Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Some basic non-empty, required, and geometry validation checking.
Comment | File | Size | Author |
---|---|---|---|
#1 | geofield-hook_validate-1857940-1.patch | 2.79 KB | alexrayu |
Comments
Comment #1
alexrayu CreditAttribution: alexrayu commentedAttached geofield-hook_validate-1857940-1.patch
Comment #2
Brandonian CreditAttribution: Brandonian commentedCommitted @arayu's patch from #1. Thanks a bunch!
http://drupalcode.org/project/geofield.git/commit/796f6b6
Keeping the ticket open, because this needs a followup. Our backend plugin system allows for plugins to define field validation callbacks. Once we've finished our base validation, we should expose a callback for the plugin to followup for any plugin specific validation.
Comment #3
tito.brasolin CreditAttribution: tito.brasolin commentedLine 180 looks strange to me: what if $items[0] is a WKT string? E.g. 'POLYGON ((19.4677...'
Function geofield_validate_geom will try and call geofield_compute_values with parameters ('P', 'P').
Comment #4
alexrayu CreditAttribution: alexrayu commentedThat line should be
$error = geofield_validate_geom($item);
Comment #5
Brandonian CreditAttribution: Brandonian commentedFixed.
http://drupalcode.org/project/geofield.git/commit/705e925
Comment #6.0
(not verified) CreditAttribution: commentedFixed a typo