diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 8f3c0811d0..f82bfd83db 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -493,10 +493,11 @@ trait JournalServiceTrait if ('' !== $string) { $tag = $this->tagFactory->findOrCreate($string); if (null !== $tag) { - $set[] = $tag->id; + $set[] = (int)$tag->id; } } } + $set = array_unique($set); Log::debug('End of loop.'); Log::debug(sprintf('Total nr. of tags: %d', count($tags)), $tags); $journal->tags()->sync($set);