Automatically closed - issue fixed for 2 weeks with no activity.
When importing via Feeds, the importer will return 0 on null values and then store that in the Lat/Lon fields. This means that anything imported without a lat/lon will wind up at 0,0 on Geofield maps, and that the filter to leave out NULL values won't work, because a Lat/Lon of 0,0 is a valid latitude and longitude.
The problem is the conversion to float in /src/Feeds/Target/Geofield.php, line 131. A condition should be added that leaves the value as NULL if it is not set.
protected function prepareValue($delta, array &$values) {
// Here is been preparing values for Lat/Lon coordinates.
foreach ($values as $column => $value) {
if (in_array($column, ['lat', 'lon'])) {
$separated_coordinates = explode(" ", $value);
$values[$column] = [];
foreach ($separated_coordinates as $coordinate) {
---> $values[$column][] = (float) $coordinate;
}
}
}
// Latitude and Longitude should be a pair, if not throw EmptyFeedException.
if (count($values['lat']) != count($values['lon'])) {
throw new EmptyFeedException('Latitude and Longitude should be a pair. Change your file and import again.');
}
}
I've attached a patch that works on my installation. I'm not sure if it's the best solution, but it works.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed - issue fixed for 2 weeks with no activity.