summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Tags.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-01-11 09:38:19 +0100
committerYorhel <git@yorhel.nl>2010-01-11 09:38:19 +0100
commit0e7f85a23414f0ef634f31af639548eabcb68c03 (patch)
tree76a816f0b78798376d6f5ce3d5f7a2beecc31d8e /lib/VNDB/Handler/Tags.pm
parent402e350d968f3a9753e20f665edf000530c654c9 (diff)
Tags: Another bugfix in the parent tags SQL query and display
It should work perfectly now...
Diffstat (limited to 'lib/VNDB/Handler/Tags.pm')
-rw-r--r--lib/VNDB/Handler/Tags.pm11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm
index edd73496..612b603d 100644
--- a/lib/VNDB/Handler/Tags.pm
+++ b/lib/VNDB/Handler/Tags.pm
@@ -73,8 +73,8 @@ sub tagpage {
h1 $title;
p;
- my @p = @{$t->{parents}};
- for my $p (_parenttags(@p)) {
+ my @p = _parenttags(@{$t->{parents}});
+ for my $p (@p ? @p : []) {
a href => '/g', mt '_tagp_indexlink';
for (reverse @$p) {
txt ' > ';
@@ -82,10 +82,6 @@ sub tagpage {
}
txt " > $t->{name}\n";
}
- if(!@p) {
- a href => '/g', mt '_tagp_indexlink';
- txt " > $t->{name}\n";
- }
end;
if($t->{description}) {
@@ -127,8 +123,7 @@ sub _parenttags {
my @r;
for my $t (@_) {
for (@{$t->{'sub'}}) {
- my @p = _parenttags($_);
- push @r, [ $t, @p?@{$p[0]}:() ];
+ push @r, [ $t, @$_ ] for _parenttags($_);
}
push @r, [$t] if !@{$t->{'sub'}};
}