fix: [user:extractPeriodicSummary] Fallback default values for periodic settings

pull/8579/head
Sami Mokaddem 2022-09-12 15:03:47 +02:00
parent 111dc2727b
commit bb968c57df
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 10 additions and 0 deletions

View File

@ -1665,6 +1665,16 @@ class User extends AppModel
$periodic_settings = array_values(array_filter($user['UserSetting'], function ($userSetting) {
return $userSetting['setting'] == self::PERIODIC_USER_SETTING_KEY;
}));
if (empty($periodic_settings)) {
$periodic_settings = [['value' => [
'orgc_id' => '',
'distribution' => -1,
'sharing_group_id' => '',
'event_info' => '',
'tags' => '[]',
'trending_for_tags' => '[]'
]]];
}
$periodic_settings_indexed = [];
if (!empty($periodic_settings)) {
foreach ($filter_names as $filter_name) {