Merge branch 'Benni0_2.4' into 2.4

pull/8560/head
Sami Mokaddem 2022-08-24 13:36:13 +02:00
commit 56aeebf3a5
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 10 additions and 9 deletions

View File

@ -1008,16 +1008,17 @@ class Feed extends AppModel
if (!isset($event['Event']['Tag'])) {
$event['Event']['Tag'] = array();
}
$found = false;
foreach ($event['Event']['Tag'] as $tag) {
if (strtolower($tag['name']) === strtolower($feed['Tag']['name'])) {
$found = true;
break;
$feedTag = $this->Tag->find('first', array('conditions' => array('Tag.id' => $feed['Feed']['tag_id']), 'recursive' => -1, 'fields' => array('Tag.name', 'Tag.colour', 'Tag.exportable')));
if (!empty($feedTag)) {
$found = false;
foreach ($event['Event']['Tag'] as $tag) {
if (strtolower($tag['name']) === strtolower($feedTag['Tag']['name'])) {
$found = true;
break;
}
}
}
if (!$found) {
$feedTag = $this->Tag->find('first', array('conditions' => array('Tag.id' => $feed['Feed']['tag_id']), 'recursive' => -1, 'fields' => array('Tag.name', 'Tag.colour', 'Tag.exportable')));
if (!empty($feedTag)) {
if (!$found) {
$event['Event']['Tag'][] = $feedTag['Tag'];
}
}