Quellcode durchsuchen

#4960 Search by location isn't working

Alex Trofimov vor 1 Jahr
Ursprung
Commit
38dab5619f
1 geänderte Dateien mit 17 neuen und 12 gelöschten Zeilen
  1. 17 12
      template/scripts/BxBaseSearchExtendedForm.php

+ 17 - 12
template/scripts/BxBaseSearchExtendedForm.php

@@ -30,21 +30,26 @@ class BxBaseSearchExtendedForm extends BxTemplFormView
         $bType = isset($this->aInputs[$sName]['type']);
         $bType = isset($this->aInputs[$sName]['type']);
 
 
         //--- Process field with 'Location' type. 
         //--- Process field with 'Location' type. 
-        if($bType && $this->aInputs[$sName]['type'] == 'location' && ($sValue = parent::getCleanValue($sName)) !== false)
-            return [
-                'string' => $sValue, 
-                'array' => BxDolMetatags::locationsRetrieveFromForm($sName, $this)
-            ];
+        if($bType && $this->aInputs[$sName]['type'] == 'location') {
+            $aLocation = BxDolMetatags::locationsRetrieveFromForm($sName, $this);
+            if ($aLocation) {
+                return [
+                    'string' => parent::getCleanValue($sName),
+                    'array' => $aLocation,
+                ];
+            }
+        }
 
 
         //--- Process field with 'Location Radius' type. 
         //--- Process field with 'Location Radius' type. 
-        if($bType && $this->aInputs[$sName]['type'] == 'location_radius' && ($sValue = parent::getCleanValue($sName)) !== false) {
+        if($bType && $this->aInputs[$sName]['type'] == 'location_radius') {
             $aLocation = BxDolMetatags::locationsRetrieveFromForm($sName, $this);
             $aLocation = BxDolMetatags::locationsRetrieveFromForm($sName, $this);
-            $aLocation[] = (int)$this->getLocationVal($this->aInputs[$sName], 'rad');
-
-            return [
-                'string' => $sValue, 
-                'array' => $aLocation
-            ];
+            if ($aLocation) {
+                $aLocation[] = (int)$this->getLocationVal($this->aInputs[$sName], 'rad');
+                return [
+                    'string' => parent::getCleanValue($sName),
+                    'array' => $aLocation,
+                ];
+            }
         }
         }
 
 
         //--- Process field with 'Date Range Age' and 'Date-Time Range Age' type.
         //--- Process field with 'Date Range Age' and 'Date-Time Range Age' type.