fix integrity constraint violations when mass-editting an image that already contains the new tag

This commit is contained in:
Daku 2016-01-24 09:56:47 +00:00
parent b328196d94
commit 9235025165

View File

@ -367,6 +367,9 @@ class TagEdit extends Extension {
$after[] = $tag;
}
// replace'd tag may already exist in tag set, so remove dupes to avoid integrity constraint violations.
$after = array_unique($after);
$image->set_tags($after);
$last_id = $image->id;