fix: [dashboard:trendingTagsWidget] Correctly use fallback value

pull/9247/head
Sami Mokaddem 2023-08-07 14:31:26 +02:00
parent e8273d9d67
commit 8bf447bba9
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class TrendingTagsWidget
/** @var Event $eventModel */
$eventModel = ClassRegistry::init('Event');
$threshold = empty($options['threshold']) ? 10 : $options['threshold'];
if (is_string($options['time_window']) && substr($options['time_window'], -1) === 'd') {
if (!empty($options['time_window']) && is_string($options['time_window']) && substr($options['time_window'], -1) === 'd') {
$time_window = ((int)substr($options['time_window'], 0, -1)) * 24 * 60 * 60;
} else {
$time_window = empty($options['time_window']) ? (7 * 24 * 60 * 60) : (int)$options['time_window'];
@ -44,6 +44,7 @@ class TrendingTagsWidget
$tagColours = [];
$allTags = [];
$data = [];
$this->render = $this->getRenderer($options);
if (!empty($options['over_time'])) {
@ -71,7 +72,6 @@ class TrendingTagsWidget
}
}
$data = [];
$data['data'] = [];
foreach($tagOvertime as $date => $tagCount) {
$item = [];