mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 09:23:28 +01:00
Home: Avoid breaking home if weather didn't find city
This commit is contained in:
parent
9a8375fa33
commit
41788aef00
@ -136,7 +136,7 @@ class home_weather_portlet extends home_portlet
|
|||||||
$current = file_get_contents($url);
|
$current = file_get_contents($url);
|
||||||
if($debug) error_log(__METHOD__ . ' current: ' . $current);
|
if($debug) error_log(__METHOD__ . ' current: ' . $current);
|
||||||
|
|
||||||
return array_merge(array('current' => json_decode($current,true)), json_decode($forecast,true));
|
return array_merge(array('current' => json_decode($current, true)), (array)json_decode($forecast, true));
|
||||||
}, array($query), self::CACHE_TIME);
|
}, array($query), self::CACHE_TIME);
|
||||||
|
|
||||||
// Some sample data, if you need to test
|
// Some sample data, if you need to test
|
||||||
|
@ -131,7 +131,7 @@ export class Et2PortletWeather extends Et2Portlet
|
|||||||
const current = this.settings?.weather?.current || {weather: [{icon: "question-lg"}], temp: {temp: "?"}};
|
const current = this.settings?.weather?.current || {weather: [{icon: "question-lg"}], temp: {temp: "?"}};
|
||||||
|
|
||||||
// Get the forecast, excluding today
|
// Get the forecast, excluding today
|
||||||
let list = this.settings.weather && (Object.values(this.settings?.weather?.list).slice(1) || []);
|
let list = this.settings.weather && (Object.values(this.settings?.weather?.list || {}).slice(1) || []);
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div
|
<div
|
||||||
|
Loading…
Reference in New Issue
Block a user