summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Tags.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-01-19 20:29:40 +0100
committerYorhel <git@yorhel.nl>2016-01-20 21:16:55 +0100
commita6836df277867d73a71c55797984c947449772cc (patch)
treec72a326dd844c3c23a932dc76dc159200c1dfcdb /lib/VNDB/Handler/Tags.pm
parent0caed2e7674e8ee7419365e76f86d06c33b8c8aa (diff)
L10N: Intern all VNDB::Util::* stuff
With some related edits in other parts of the code, mostly due to interface changes to htmlRevision() and htmlFormError(). Trivial replacements were automated by a super awesome script.
Diffstat (limited to 'lib/VNDB/Handler/Tags.pm')
-rw-r--r--lib/VNDB/Handler/Tags.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm
index bb6dd2d4..64c69caa 100644
--- a/lib/VNDB/Handler/Tags.pm
+++ b/lib/VNDB/Handler/Tags.pm
@@ -165,12 +165,9 @@ sub tagedit {
my @parents = split /[\t\s]*,[\t\s]*/, $frm->{parents};
my @merge = split /[\t\s]*,[\t\s]*/, $frm->{merge};
if(!$frm->{_err}) {
- my $c = $self->dbTagGet(name => $frm->{name}, noid => $tag);
- push @{$frm->{_err}}, [ 'name', 'tagexists', $c->[0] ] if @$c;
- for (@aliases) {
- $c = $self->dbTagGet(name => $_, noid => $tag);
- push @{$frm->{_err}}, [ 'alias', 'tagexists', $c->[0] ] if @$c;
- }
+ my @dups = @{$self->dbTagGet(name => $frm->{name}, noid => $tag)};
+ push @dups, @{$self->dbTagGet(name => $_, noid => $tag)} for @aliases;
+ push @{$frm->{_err}}, \sprintf 'Tag <a href="/g%d">%s</a> already exists!', $_->{id}, xml_escape $_->{name} for @dups;
for(@parents, @merge) {
my $c = $self->dbTagGet(name => $_, noid => $tag);
push @{$frm->{_err}}, [ 'parents', 'func', [ 0, mt '_tagedit_err_notfound', $_ ]] if !@$c;