Actually build an array of items in getRssFeedItems. Fix several method modifiers.

This commit is contained in:
Colin Kuskie 2010-05-21 19:26:55 -07:00
parent 3faacabed2
commit 0fac75759e

View file

@ -217,6 +217,7 @@ sub getRssFeedItems {
author => $item->author, author => $item->author,
guid => $item->guid, guid => $item->guid,
); );
push @items, \%feed_item;
} }
return \@items; return \@items;
} }
@ -294,11 +295,12 @@ See WebGUI::Asset::prepareView() for details.
=cut =cut
sub prepareView { around prepareView => sub {
my $orig = shift;
my $self = shift; my $self = shift;
$self->next::method; $self->$orig();
my $template = WebGUI::Asset::Template->newById($self->session, $self->templateId); my $template = eval { WebGUI::Asset->newById($self->session, $self->templateId); };
if (!$template) { if (Exception::Class->caught()) {
WebGUI::Error::ObjectNotFound::Template->throw( WebGUI::Error::ObjectNotFound::Template->throw(
error => qq{Template not found}, error => qq{Template not found},
templateId => $self->templateId, templateId => $self->templateId,
@ -307,7 +309,7 @@ sub prepareView {
} }
$template->prepare($self->getMetaDataAsTemplateVariables); $template->prepare($self->getMetaDataAsTemplateVariables);
$self->{_viewTemplate} = $template; $self->{_viewTemplate} = $template;
} };
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -359,11 +361,11 @@ See WebGUI::Asset::Wobject::www_view() for details.
=cut =cut
sub www_view { override www_view => sub {
my $self = shift; my $self = shift;
$self->session->http->setCacheControl($self->cacheTimeout); $self->session->http->setCacheControl($self->cacheTimeout);
$self->next::method(@_); super();
} };
__PACKAGE__->meta->make_immutable; __PACKAGE__->meta->make_immutable;
1; 1;