summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-05-12 13:50:24 +0200
committerYorhel <git@yorhel.nl>2015-05-12 13:50:24 +0200
commita87f36b5f175d76a744e1a72af708eb89b3582c7 (patch)
tree0b06320f95eee59ec9fa0c7c6b5b21050f5301c9
parent4fc2557b652b0f9c7bd053b020434e64d9ab4fa1 (diff)
Handler::Tags: Don't allow adding deleted tags to a VN
-rw-r--r--lib/VNDB/Handler/Tags.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm
index 6b822d90..f3781c5d 100644
--- a/lib/VNDB/Handler/Tags.pm
+++ b/lib/VNDB/Handler/Tags.pm
@@ -512,6 +512,9 @@ sub vntagmod {
$update{$t} = [ $new{$t}[0], $new{$t}[1] ];
}
}
+ # remove tags in the deleted state.
+ delete $insert{$_->{id}} for(keys %insert ? @{$self->dbTagGet(id => [ keys %insert ], state => 1)} : ());
+
$self->dbTagLinkEdit($self->authInfo->{id}, $vid, \%insert, \%update, \%delete, \%overrule);
# need to re-fetch the tags and tag links, as these have been modified