gracefully handle Collaborations having no lastPostId in the MessageBoard asset
This commit is contained in:
parent
9a45ff4b91
commit
fab70d71c7
2 changed files with 18 additions and 15 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
- fixed #12384: Click and drag reordering does not work in IE9
|
- fixed #12384: Click and drag reordering does not work in IE9
|
||||||
- fixed: MessageBoard tolerates Collaboration children not yet having a value for lastPostId
|
- fixed: MessageBoard tolerates Collaboration children not yet having a value for lastPostId
|
||||||
- on invalid proceed method in call to editSave, warn and recover rather than run time error
|
- on invalid proceed method in call to editSave, warn and recover rather than run time error
|
||||||
|
- gracefully handle Collaborations having no lastPostId in the MessageBoard asset
|
||||||
|
|
||||||
7.10.26
|
7.10.26
|
||||||
- fixed: Template diagnostics when called without a session asset.
|
- fixed: Template diagnostics when called without a session asset.
|
||||||
|
|
|
||||||
|
|
@ -129,21 +129,23 @@ sub view {
|
||||||
$first = $child;
|
$first = $child;
|
||||||
}
|
}
|
||||||
my %lastPostVars;
|
my %lastPostVars;
|
||||||
my $lastPost = WebGUI::Asset::Wobject::MessageBoard->newByDynamicClass($self->session, $child->get("lastPostId"));
|
if( $child->get('lastPostId') ) {
|
||||||
if (defined $lastPost) {
|
my $lastPost = WebGUI::Asset::Wobject::MessageBoard->newByDynamicClass($self->session, $child->get("lastPostId"));
|
||||||
%lastPostVars = (
|
if (defined $lastPost) {
|
||||||
'forum.lastPost.url' => $lastPost->getUrl,
|
%lastPostVars = (
|
||||||
'forum.lastPost.date' => $self->session->datetime->epochToHuman($lastPost->get("creationDate"),"%z"),
|
'forum.lastPost.url' => $lastPost->getUrl,
|
||||||
'forum.lastPost.time' => $self->session->datetime->epochToHuman($lastPost->get("creationDate"),"%Z"),
|
'forum.lastPost.date' => $self->session->datetime->epochToHuman($lastPost->get("creationDate"),"%z"),
|
||||||
'forum.lastPost.epoch' => $lastPost->get("creationDate"),
|
'forum.lastPost.time' => $self->session->datetime->epochToHuman($lastPost->get("creationDate"),"%Z"),
|
||||||
'forum.lastPost.subject' => $lastPost->get("title"),
|
'forum.lastPost.epoch' => $lastPost->get("creationDate"),
|
||||||
'forum.lastPost.user.hasRead' => $lastPost->getThread->isMarkedRead,
|
'forum.lastPost.subject' => $lastPost->get("title"),
|
||||||
'forum.lastPost.user.id' => $lastPost->get("ownerUserId"),
|
'forum.lastPost.user.hasRead' => $lastPost->getThread->isMarkedRead,
|
||||||
'forum.lastPost.user.name' => $lastPost->get("username"),
|
'forum.lastPost.user.id' => $lastPost->get("ownerUserId"),
|
||||||
'forum.lastPost.user.alias' => $lastPost->get("username"),
|
'forum.lastPost.user.name' => $lastPost->get("username"),
|
||||||
'forum.lastPost.user.profile' => $lastPost->getPosterProfileUrl,
|
'forum.lastPost.user.alias' => $lastPost->get("username"),
|
||||||
'forum.lastPost.user.isVisitor' => ($lastPost->get("ownerUserId") eq '1')
|
'forum.lastPost.user.profile' => $lastPost->getPosterProfileUrl,
|
||||||
);
|
'forum.lastPost.user.isVisitor' => ($lastPost->get("ownerUserId") eq '1')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
push(@forum_loop, {
|
push(@forum_loop, {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue