summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Traits.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/Traits.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/Traits.pm')
-rw-r--r--lib/VNDB/Handler/Traits.pm11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/VNDB/Handler/Traits.pm b/lib/VNDB/Handler/Traits.pm
index 4b106fa2..979ea0d6 100644
--- a/lib/VNDB/Handler/Traits.pm
+++ b/lib/VNDB/Handler/Traits.pm
@@ -3,7 +3,7 @@ package VNDB::Handler::Traits;
use strict;
use warnings;
-use TUWF ':html', ':xml', 'html_escape';
+use TUWF ':html', ':xml', 'html_escape', 'xml_escape';
use VNDB::Func;
@@ -158,12 +158,9 @@ sub traitedit {
}
}
if(!$frm->{_err}) {
- my $c = $self->dbTraitGet(name => $frm->{name}, noid => $trait, group => $group);
- push @{$frm->{_err}}, [ 'name', 'traitexists', $c->[0] ] if @$c;
- for (split /[\t\s]*\n[\t\s]*/, $frm->{alias}) {
- $c = $self->dbTraitGet(name => $_, noid => $trait, group => $group);
- push @{$frm->{_err}}, [ 'alias', 'traitexists', $c->[0] ] if @$c;
- }
+ my @dups = @{$self->dbTraitGet(name => $frm->{name}, noid => $trait, group => $group)};
+ push @dups, @{$self->dbTraitGet(name => $_, noid => $trait, group => $group)} for split /[\t\s]*\n[\t\s]*/, $frm->{alias};
+ push @{$frm->{_err}}, \sprintf 'Trait <a href="/c%d">%s</a> already exists within the same group.', $_->{id}, xml_escape $_->{name} for @dups;
}
if(!$frm->{_err}) {