diff options
author | Yorhel <git@yorhel.nl> | 2019-11-15 17:04:41 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-11-15 17:06:23 +0100 |
commit | 34a2d37a7bac141aab6b0c815a17ed75d4ef858e (patch) | |
tree | 87ec011c9281811019c441e92b66c7b009e70681 /lib/VNDB/Handler/Discussions.pm | |
parent | 4580ee0776e4e8a32ec99dc0506625a6e061c854 (diff) |
Move pubskin fetching responsibility to VNWeb::HTML::framework_
Requiring callers to fetch the right fields and pass it along to
framework_() just seems brittle. This implementation requires an extra
query but does make an effort to avoid fetching the skin and css when
it's not needed.
Diffstat (limited to 'lib/VNDB/Handler/Discussions.pm')
-rw-r--r-- | lib/VNDB/Handler/Discussions.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm index add0e51c..ac4bd190 100644 --- a/lib/VNDB/Handler/Discussions.pm +++ b/lib/VNDB/Handler/Discussions.pm @@ -389,7 +389,7 @@ sub board { return $self->resNotFound if $f->{_err}; my $obj = !$iid ? undef : - $type eq 'u' ? $self->dbUserGet(uid => $iid, what => 'hide_list pubskin')->[0] : + $type eq 'u' ? $self->dbUserGet(uid => $iid, what => 'hide_list')->[0] : $type eq 'p' ? $self->dbProducerGet(id => $iid)->[0] : $self->dbVNGet(id => $iid)->[0]; return $self->resNotFound if $iid && !$obj; @@ -406,7 +406,7 @@ sub board { asuser => $self->authInfo()->{id}, ); - $self->htmlHeader(title => $title, noindex => 1, feeds => [ $type eq 'an' ? 'announcements' : 'posts' ], $type eq 'u' && $obj ? (pubskin => $obj) : ()); + $self->htmlHeader(title => $title, noindex => 1, feeds => [ $type eq 'an' ? 'announcements' : 'posts' ], type => $type, dbobj => $obj); $self->htmlMainTabs($type, $obj, 'disc') if $iid; form action => '/t/search', method => 'get'; |