! binds more tightly than ~~
This commit is contained in:
parent
0180b11064
commit
4e1ac0a8e3
2 changed files with 2 additions and 3 deletions
|
|
@ -1161,7 +1161,7 @@ sub getThreadsPaginator {
|
|||
$sortBy =~ s/^\w+\.//;
|
||||
# Sort by the thread rating instead of the post rating. other places don't care about threads.
|
||||
$sortBy = $sortBy eq 'rating' ? 'threadRating' : $sortBy;
|
||||
if (! $sortBy ~~ [qw/userDefined1 userDefined2 userDefined3 userDefined4 userDefined5 title lineage revisionDate creationDate karmaRank threadRating views replies lastPostDate/]) {
|
||||
if (! ($sortBy ~~ [qw/userDefined1 userDefined2 userDefined3 userDefined4 userDefined5 title lineage revisionDate creationDate karmaRank threadRating views replies lastPostDate/])) {
|
||||
$sortBy = 'revisionDate';
|
||||
}
|
||||
if ($sortBy eq 'assetId' || $sortBy eq 'revisionDate') {
|
||||
|
|
|
|||
|
|
@ -86,14 +86,13 @@ $session->db->write(
|
|||
'UPDATE Collaboration SET sortBy=NULL,sortOrder=NULL WHERE assetId=?',
|
||||
[$collab->getId]
|
||||
);
|
||||
my $collab2 = WebGUI::Asset::Wobject::Collaboration->new( $session, $collab->getId );
|
||||
my $collab2 = WebGUI::Asset::Wobject::Collaboration->newById( $session, $collab->getId );
|
||||
$p = $collab2->getThreadsPaginator;
|
||||
$page = $p->getPageData;
|
||||
$expect = sortThreads( sub { $b->get('revisionDate') <=> $a->get('revisionDate') }, @threads );
|
||||
cmp_deeply( $page, $expect, 'getThreadsPaginator sort by no default' )
|
||||
or diag( "GOT: " . Dumper $page ), diag( "EXPECTED: " . Dumper $expect );
|
||||
undef $collab2;
|
||||
|
||||
# sortBy default from asset
|
||||
$collab->update({
|
||||
sortBy => 'assetData.revisionDate',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue