Merge pull request #541 from DakuTree/patch-constraints

Fix constraint violations when mass-editing an image that already contains the new tag
This commit is contained in:
Shish 2016-01-25 11:16:25 +00:00
commit cfad6087ab

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;