I get several of these warnings when adding a "distance" field.
This is due to the missing options in option_definition. I don't pretend to understand Views, but this patch seems to make the error go away.
diff --git a/handlers/geolocation_proximity_views_handler_field_distance.inc b/handlers/geolocation_proximity_views_handler_field_distance.inc
index be91ac2..ad94a02 100644
--- a/handlers/geolocation_proximity_views_handler_field_distance.inc
+++ b/handlers/geolocation_proximity_views_handler_field_distance.inc
@@ -61,6 +61,13 @@ class geolocation_proximity_views_handler_field_distance extends views_handler_f
),
),
);
+ $options['use_filter'] = array('default' => FALSE);
+ $options['location'] = array(
+ 'contains' => array(
+ 'latitude' => array('default' => ''),
+ 'longitude' => array('default' => '')
+ )
+ );
return $options;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | geolocation_proximity-1.png | 12.91 KB | derjochenmeyer |
| #2 | geolocation_proximity-2.png | 26.59 KB | derjochenmeyer |
| #1 | geolocation_proximity-add_default_options_to_distance_field-1658832-1.patch | 703 bytes | derjochenmeyer |
Comments
Comment #1
derjochenmeyer commentedThese are the errors:
Added a patch for testing.
@Peter Bex: Thanks for reporting and the patch!
Comment #2
derjochenmeyer commentedI tested this on simplytest.me
It seems this patch needs more work. If distance FIELD and exposed distance FILTER are used together things start working only after entering default values for latitude and longitude (e.g. 0) in both filter and field. These default values are ALSO needed if the reference for calculating the distance is set to use the filter values!
It seems we need a patch that at least sets default values to 0.