summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/Handler/Chars.pm3
-rw-r--r--lib/VNDB/Handler/Traits.pm1
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/VNDB/Handler/Chars.pm b/lib/VNDB/Handler/Chars.pm
index 5caf677e..ab4a5627 100644
--- a/lib/VNDB/Handler/Chars.pm
+++ b/lib/VNDB/Handler/Chars.pm
@@ -339,6 +339,9 @@ sub edit {
$frm->{desc} = $self->bbSubstLinks($frm->{desc});
$frm->{main_spoil} = 0 if !$frm->{main};
+ my %traits = map +($_->{id}, 1), @{$self->dbTraitGet(results => 500, state => 2, id => [ map $_->[0], @traits ])};
+ @traits = grep $traits{$_->[0]}, @traits;
+
# check for changes
my $same = $id && !grep $frm->{$_} ne $b4{$_}, keys %b4;
return $self->resRedirect("/c$id", 'post') if !$copy && $same;
diff --git a/lib/VNDB/Handler/Traits.pm b/lib/VNDB/Handler/Traits.pm
index 0f4169aa..41057c44 100644
--- a/lib/VNDB/Handler/Traits.pm
+++ b/lib/VNDB/Handler/Traits.pm
@@ -413,6 +413,7 @@ sub traitxml {
results => $f->{r},
page => 1,
sort => 'group',
+ state => 2,
!$f->{q} ? () : $f->{q} =~ /^i([1-9]\d*)/ ? (id => $1) : (search => $f->{q}, sort => 'search'),
$f->{id} && $f->{id}[0] ? (id => $f->{id}) : (),
);