Fix bad index variables in the CS. Fixes bug #11172.
This commit is contained in:
parent
9f9c1ab277
commit
9a17cfe0cd
3 changed files with 55 additions and 7 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
- fixed #11168: Points do not work with uncommitted Map
|
- fixed #11168: Points do not work with uncommitted Map
|
||||||
- fixed #10888: Add Point... how do I enter details?
|
- fixed #10888: Add Point... how do I enter details?
|
||||||
- fixed #10887: Map Point dropdown doesn't update
|
- fixed #10887: Map Point dropdown doesn't update
|
||||||
|
- fixed #11172: Collaboration broken vars: isSecond, isThird etc.
|
||||||
|
|
||||||
7.8.2
|
7.8.2
|
||||||
- Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi)
|
- Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi)
|
||||||
|
|
|
||||||
|
|
@ -166,10 +166,10 @@ sub appendPostListTemplateVars {
|
||||||
"user.isVisitor" => $post->get("ownerUserId") eq "1",
|
"user.isVisitor" => $post->get("ownerUserId") eq "1",
|
||||||
"edit.url" => $post->getEditUrl,
|
"edit.url" => $post->getEditUrl,
|
||||||
'controls' => $controls,
|
'controls' => $controls,
|
||||||
"isSecond" => (($i+1)%2==0),
|
"isSecond" => (($i+1) == 2),
|
||||||
"isThird" => (($i+1)%3==0),
|
"isThird" => (($i+1) == 3),
|
||||||
"isFourth" => (($i+1)%4==0),
|
"isFourth" => (($i+1) == 4),
|
||||||
"isFifth" => (($i+1)%5==0),
|
"isFifth" => (($i+1) == 5),
|
||||||
"user.hasRead" => $hasRead,
|
"user.hasRead" => $hasRead,
|
||||||
"user.isPoster" => $post->isPoster,
|
"user.isPoster" => $post->isPoster,
|
||||||
"avatar.url" => $post->getAvatarUrl,
|
"avatar.url" => $post->getAvatarUrl,
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,12 @@ use WebGUI::Session;
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Tests
|
# Tests
|
||||||
plan tests => 20; # Increment this number for each test you create
|
plan tests => 21; # Increment this number for each test you create
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Init
|
# Init
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
my @addChildArgs = ( {skipAutoCommitWorkflows=>1} );
|
my @addChildArgs = ( {skipAutoCommitWorkflows=>1, skipNotification => 1, } );
|
||||||
my $collab = WebGUI::Asset->getImportNode( $session )->addChild({
|
my $collab = WebGUI::Asset->getImportNode( $session )->addChild({
|
||||||
className => 'WebGUI::Asset::Wobject::Collaboration',
|
className => 'WebGUI::Asset::Wobject::Collaboration',
|
||||||
threadsPerPage => 20,
|
threadsPerPage => 20,
|
||||||
|
|
@ -54,7 +54,7 @@ my @threads = (
|
||||||
$_->setSkipNotification for @threads; # 100+ messages later...
|
$_->setSkipNotification for @threads; # 100+ messages later...
|
||||||
my $versionTag = WebGUI::VersionTag->getWorking( $session );
|
my $versionTag = WebGUI::VersionTag->getWorking( $session );
|
||||||
$versionTag->commit;
|
$versionTag->commit;
|
||||||
WebGUI::Test->tagsToRollback($versionTag);
|
addToCleanup($versionTag);
|
||||||
|
|
||||||
my $templateVars;
|
my $templateVars;
|
||||||
my $posts;
|
my $posts;
|
||||||
|
|
@ -89,4 +89,51 @@ ok( !$posts->[0]->{'user.isVisitor'}, 'first post made by visitor');
|
||||||
ok( $posts->[0]->{'hideProfileUrl'}, 'hide profile url, and user is visitor');
|
ok( $posts->[0]->{'hideProfileUrl'}, 'hide profile url, and user is visitor');
|
||||||
ok( !$posts->[0]->{'lastReply.user.isVisitor'}, 'lastReply not made by visitor');
|
ok( !$posts->[0]->{'lastReply.user.isVisitor'}, 'lastReply not made by visitor');
|
||||||
ok( $posts->[0]->{'lastReply.hideProfileUrl'}, 'lastReply hide profile url, since user is visitor');
|
ok( $posts->[0]->{'lastReply.hideProfileUrl'}, 'lastReply hide profile url, since user is visitor');
|
||||||
|
|
||||||
|
|
||||||
|
###################################################################
|
||||||
|
#
|
||||||
|
#isSecond, isThird, etc.
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
my @newThreads = ();
|
||||||
|
foreach my $index (1 .. 5) {
|
||||||
|
$newThreads[$index] = $collab->addChild( {
|
||||||
|
className => 'WebGUI::Asset::Post::Thread',
|
||||||
|
title => "X - Bar",
|
||||||
|
isSticky => 0,
|
||||||
|
ownerUserId => 3,
|
||||||
|
}, undef, 2+$index, @addChildArgs);
|
||||||
|
$newThreads[$index]->setSkipNotification;
|
||||||
|
}
|
||||||
|
my $vt2 = WebGUI::VersionTag->getWorking($session);
|
||||||
|
$vt2->commit;
|
||||||
|
addToCleanup($versionTag);
|
||||||
|
|
||||||
|
$session->user({userId => 3});
|
||||||
|
$templateVars = $collab->getViewTemplateVars();
|
||||||
|
my $indexVars;
|
||||||
|
foreach my $post (@{ $templateVars->{post_loop }}) {
|
||||||
|
push @{$indexVars}, {
|
||||||
|
isSecond => $post->{isSecond} ? 1 : 0,
|
||||||
|
isThird => $post->{isThird} ? 1 : 0,
|
||||||
|
isFourth => $post->{isFourth} ? 1 : 0,
|
||||||
|
isFifth => $post->{isFifth} ? 1 : 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
cmp_deeply(
|
||||||
|
$indexVars,
|
||||||
|
[
|
||||||
|
{ isSecond => 0, isThird => 0, isFourth => 0, isFifth => 0, },
|
||||||
|
{ isSecond => 1, isThird => 0, isFourth => 0, isFifth => 0, },
|
||||||
|
{ isSecond => 0, isThird => 1, isFourth => 0, isFifth => 0, },
|
||||||
|
{ isSecond => 0, isThird => 0, isFourth => 1, isFifth => 0, },
|
||||||
|
{ isSecond => 0, isThird => 0, isFourth => 0, isFifth => 1, },
|
||||||
|
{ isSecond => 0, isThird => 0, isFourth => 0, isFifth => 0, }, ##No modulo
|
||||||
|
{ isSecond => 0, isThird => 0, isFourth => 0, isFifth => 0, }, ##No modulo
|
||||||
|
],
|
||||||
|
'checking isSecond, isThird, isFourth, isFifth'
|
||||||
|
);
|
||||||
#vim:ft=perl
|
#vim:ft=perl
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue