chg: [user:saveNotificationSettings] Save tags setting as empty array if not provided

pull/8575/head
Sami Mokaddem 2022-09-08 10:57:17 +02:00
parent 00c818cb45
commit 6c3a5f5dd0
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 7 additions and 3 deletions

View File

@ -1695,9 +1695,13 @@ class User extends AppModel
]);
if ($success) {
$periodic_settings = $data['periodic_settings'];
$decodedTags = json_decode($periodic_settings['tags'], true);
if ($decodedTags === null) {
return false;
if (empty($periodic_settings['tags'])) {
$periodic_settings['tags'] = '[]';
} else {
$decodedTags = json_decode($periodic_settings['tags'], true);
if ($decodedTags === null) {
return false;
}
}
$notification_filters = [
'orgc_id' => $periodic_settings['orgc_id'] ?? [],