From 1c70821a6f1119d1ab42e56fc7a6399ab51c0aca Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 2 May 2010 01:17:56 -0700 Subject: [PATCH] Really make the wiki sort by popularity (then lineage). Fixes bug #11537 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/WikiMaster.pm | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 18cc7c2e8..ad4eb3b57 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -13,6 +13,7 @@ - added #11498: Gallery: Automatically adjust orientation of images based on EXIF data - fixed #11547: Default Inbox View Template Delete buttton failure - fixed #11542: Date macro can pass in epoch values that do not pass regex checks + - fixed #11537: Wiki, sorting by most popular 7.9.3 - added #11477: No synopsis in asset now means no synopsis in search index diff --git a/lib/WebGUI/Asset/Wobject/WikiMaster.pm b/lib/WebGUI/Asset/Wobject/WikiMaster.pm index 35256ffd2..c8a37ee46 100644 --- a/lib/WebGUI/Asset/Wobject/WikiMaster.pm +++ b/lib/WebGUI/Asset/Wobject/WikiMaster.pm @@ -76,10 +76,10 @@ If passed in, this will override the mostPopularCount set in the object. =cut sub appendMostPopular { - my $self = shift; - my $var = shift; - my $limit = shift || $self->get("mostPopularCount"); - foreach my $asset (@{$self->getLineage(["children"],{returnObjects=>1, limit=>$limit, includeOnlyClasses=>["WebGUI::Asset::WikiPage"]})}) { + my $self = shift; + my $var = shift; + my $limit = shift || $self->get("mostPopularCount"); + foreach my $asset (@{$self->getLineage(["children"],{returnObjects=>1, limit=>$limit, includeOnlyClasses=>["WebGUI::Asset::WikiPage"], joinClass => 'WebGUI::Asset::WikiPage', orderByClause => 'WikiPage.views DESC'})}) { if (defined $asset) { push(@{$var->{mostPopular}}, { title=>$asset->getTitle,