mcguffin / acf-openstreetmap-field

WordPress ACF Field for OpenStreetMap
https://wordpress.org/plugins/acf-openstreetmap-field/
GNU General Public License v3.0
107 stars 22 forks source link

Validation fail. 'Open Street value is required' #8

Closed anthonyomalley closed 5 years ago

anthonyomalley commented 5 years ago

If the openstreetmap field is set to required, I see 'Validation failed. 1 field requires attention' when attempting to publish despite the field being completed (a marker placed and an address inserted in the input beneath the map).

Also, if the openstreetmap field is set as conditional and hidden until another field is completed, only the top left corner of the map renders correctly, the rest remains grey.

mortensassi commented 5 years ago

Still getting the error described by OP

EDIT:

The code you have added is always true. Maybe checking if markers are set but $value is an object as a sanitized string...

if ( empty($value) || empty($value['lat']) || empty($value['lng'] ) ) {
    return false;
}