fix: [user:periodic_notification] Perform filtering on event tags only for aggregated context

This is for restSearch to stay consistent with how events are fetched by the default fetcher
pull/8575/head
Sami Mokaddem 2022-08-31 14:54:27 +02:00
parent 406cda070e
commit f23e582760
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 5 additions and 1 deletions

View File

@ -1755,6 +1755,10 @@ class User extends AppModel
$filtersForRestSearch['returnFormat'] = 'context';
$filtersForRestSearch['staticHtml'] = true;
unset($filtersForRestSearch['last']);
if (!empty($filtersForRestSearch['tags'])) {
$filtersForRestSearch['event_tags'] = $filtersForRestSearch['tags'];
unset($filtersForRestSearch['tags']);
}
$final = $this->Event->restSearch($user, 'context', $filtersForRestSearch, false, false, $elementCounter, $renderView);
$final = json_decode($final->intoString(), true);
$aggregated_context = $this->__renderAggregatedContext($final);

View File

@ -56,7 +56,7 @@ echo $this->element('genericElements/Form/genericForm', [
],
[
'field' => 'periodic_settings.tags',
'label' => __('Tag list'),
'label' => __('Event Tags'),
'type' => 'tagsPicker',
'placeholder' => '["tlp:red"]',
],