diff --git a/lib/Connector/OpenWeatherMapConnector.php b/lib/Connector/OpenWeatherMapConnector.php index 6386bbfddf..9f35768f61 100644 --- a/lib/Connector/OpenWeatherMapConnector.php +++ b/lib/Connector/OpenWeatherMapConnector.php @@ -151,8 +151,8 @@ private function getWeatherData(DataProviderInterface $dataProvider) } // Build the URL - $url = '?lat=' . ($providedLat ?? '') - . '&lon=' . ($providedLon ?? '') + $url = '?lat=' . $providedLat + . '&lon=' . $providedLon . '&units=' . $units . '&lang=' . $dataProvider->getProperty('lang', 'en') . '&appid=[API_KEY]'; diff --git a/lib/XTR/WidgetSyncTask.php b/lib/XTR/WidgetSyncTask.php index 3d74c45412..4b4bdf7681 100644 --- a/lib/XTR/WidgetSyncTask.php +++ b/lib/XTR/WidgetSyncTask.php @@ -194,14 +194,11 @@ private function cache( $dataProvider->setMediaFactory($this->mediaFactory); // Set our provider up for the display - if ($display !== null) { - $dataProvider->setDisplayProperties($display->latitude, $display->longitude, $display->displayId); - } else { - $dataProvider->setDisplayProperties( - $this->getConfig()->getSetting('DEFAULT_LAT'), - $this->getConfig()->getSetting('DEFAULT_LONG') - ); - } + $dataProvider->setDisplayProperties( + $display?->latitude ?: $this->getConfig()->getSetting('DEFAULT_LAT'), + $display?->longitude ?: $this->getConfig()->getSetting('DEFAULT_LONG'), + $display?->displayId ?? 0 + ); $widgetDataProviderCache = $this->moduleFactory->createWidgetDataProviderCache(); diff --git a/lib/Xmds/Soap.php b/lib/Xmds/Soap.php index d181decdbe..489e4c1cfa 100644 --- a/lib/Xmds/Soap.php +++ b/lib/Xmds/Soap.php @@ -928,8 +928,8 @@ protected function doRequiredFiles( // this region? $dataProvider = $dataModule->createDataProvider($widget); $dataProvider->setDisplayProperties( - $this->display->latitude, - $this->display->longitude, + $this->display->latitude ?: $this->getConfig()->getSetting('DEFAULT_LAT'), + $this->display->longitude ?: $this->getConfig()->getSetting('DEFAULT_LONG'), $this->display->displayId ); @@ -2375,8 +2375,8 @@ protected function doGetResource( // We only ever return cache. $dataProvider = $dataModule->createDataProvider($widget); $dataProvider->setDisplayProperties( - $this->display->latitude, - $this->display->longitude, + $this->display->latitude ?: $this->getConfig()->getSetting('DEFAULT_LAT'), + $this->display->longitude ?: $this->getConfig()->getSetting('DEFAULT_LONG'), $this->display->displayId ); diff --git a/lib/Xmds/Soap7.php b/lib/Xmds/Soap7.php index ced7ab4a1c..5816045e83 100644 --- a/lib/Xmds/Soap7.php +++ b/lib/Xmds/Soap7.php @@ -129,8 +129,8 @@ public function GetData($serverKey, $hardwareKey, $widgetId) // We only ever return cache. $dataProvider = $module->createDataProvider($widget); $dataProvider->setDisplayProperties( - $this->display->latitude, - $this->display->longitude, + $this->display->latitude ?: $this->getConfig()->getSetting('DEFAULT_LAT'), + $this->display->longitude ?: $this->getConfig()->getSetting('DEFAULT_LONG'), $this->display->displayId );