From 2b8a3c279dae47b1107448252ebbb82fb0fa271e Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 16 Oct 2008 16:16:23 +0000 Subject: [PATCH] Fixed a limit bug in the asset discovery service. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Gallery.pm | 4 ++-- lib/WebGUI/Content/AssetDiscovery.pm | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 481d7d364..9dd64ca49 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,6 @@ 7.6.2 - fixed #8839: Documentation is wrong for Stock Ticker + - Fixed a limit bug in the asset discovery service. 7.6.1 - changed: the list of extensions for the export system to pass through diff --git a/lib/WebGUI/Asset/Wobject/Gallery.pm b/lib/WebGUI/Asset/Wobject/Gallery.pm index aaaa16360..6f8ccc043 100644 --- a/lib/WebGUI/Asset/Wobject/Gallery.pm +++ b/lib/WebGUI/Asset/Wobject/Gallery.pm @@ -1276,10 +1276,10 @@ sub www_listAlbumsService { my $count = 1; for my $assetId ( @{ $self->getAlbumIds } ) { - if ($count < $pageNumber * 100 - 99) { # skip low page numbers + if ($count < $pageNumber * 100 - 100) { # skip low page numbers next; } - if ($count > $pageNumber * 100) { # skip high page numbers + if ($count > $pageNumber * 100 - 1) { # skip high page numbers last; } my $asset = WebGUI::Asset->new( $session, $assetId, 'WebGUI::Asset::Wobject::GalleryAlbum' ); diff --git a/lib/WebGUI/Content/AssetDiscovery.pm b/lib/WebGUI/Content/AssetDiscovery.pm index a5dff9465..28bc9556e 100644 --- a/lib/WebGUI/Content/AssetDiscovery.pm +++ b/lib/WebGUI/Content/AssetDiscovery.pm @@ -109,10 +109,10 @@ sub handler { my $class = $form->get('className'); if ($class ne '') { my $start = WebGUI::Asset->newByUrl($session); - my $limit = ($pageNumber * 100 - 99).','.($pageNumber * 100); + my $limit = ($pageNumber * 100 - 100).','.($pageNumber * 100 - 1); my $siteUrl = $session->url->getSiteURL; my $date = $session->datetime; - my $matchingAssets = $session->db->read("select assetId from asset where lineage like ? and className like ? limit ".$limit, [$start->get('lineage').'%', $class.'%']); + my $matchingAssets = $session->db->read("select assetId from asset where lineage like ? and className=? limit ".$limit, [$start->get('lineage').'%', $class]); while (my ($id) = $matchingAssets->array) { my $asset = WebGUI::Asset->new($session, $id, $class); if (defined $asset) {