Error: Call to a member function getParsedReferenceLocation() on array in Drupal\geofield\Plugin\GeofieldProximitySource\ContextProximityFilter->getOrigin() (line 79
ContextProximityFilter is running on views where there is no argument of type GeofieldProximityArgument.
public function getOrigin() {
$origin = [];
if (isset($this->viewHandler)) {
/** @var \Drupal\geofield\Plugin\views\argument\GeofieldProximityArgument $geofield_proximity_argument */
$geofield_proximity_argument = $this->viewHandler->view->argument;
foreach ($this->viewHandler->view->argument as $argument) {
if ($argument instanceof GeofieldProximityArgument) {
$geofield_proximity_argument = $argument;
}
}
if (isset($geofield_proximity_argument) && $argument_values = $geofield_proximity_argument->getParsedReferenceLocation()) {
$origin = [
'lat' => $argument_values['lat'],
'lon' => $argument_values['lon'],
];
}
}
return $origin;
If no argument from the view handler is an instance of GeofieldProximityArgument then $geofield_proximity_argument is incorrectly set to the array of arguments from the view handler.
Set $geofield_proximity_argument to NULL initially. A patch and MR to follow shortly.
Review.
None.
None.
Fixed
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.