Merge pull request #7833 from JakubOnderka/fix-local-tags

fix: [internal] Fix saving tags
pull/7842/head
Jakub Onderka 2021-10-12 12:24:23 +02:00 committed by GitHub
commit b52962b2a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -3463,7 +3463,10 @@ class Event extends AppModel
foreach ($event['Tag'] as $tag) {
$tag_id = $this->captureTagWithCache($tag, $user, $capturedTags);
if ($tag_id && !in_array($tag_id, $event_tag_ids)) {
$eventTags[] = array('tag_id' => $tag_id, 'local' => $tag['local']);
$eventTags[] = [
'tag_id' => $tag_id,
'local' => isset($tag['local']) ? $tag['local'] : 0,
];
$event_tag_ids[] = $tag_id;
}
}
@ -3533,7 +3536,10 @@ class Event extends AppModel
foreach ($a['Tag'] as $tag) {
$tagId = $this->captureTagWithCache($tag, $user, $capturedTags);
if ($tagId) {
$attributeTags[] = array('tag_id' => $tagId);
$attributeTags[] = [
'tag_id' => $tagId,
'local' => isset($tag['local']) ? $tag['local'] : 0,
];
}
}
unset($attributes[$k]['Tag']);