Handle the edge case where no fields are to be returned in a Thingy search. Fixes bug #11587

This commit is contained in:
Colin Kuskie 2010-05-25 12:02:32 -07:00
parent 7a1487be55
commit 9cfcf84c2f
2 changed files with 10 additions and 7 deletions

View file

@ -8,6 +8,7 @@
- fixed #11584: Errors on checkout when payment problems occur - fixed #11584: Errors on checkout when payment problems occur
- fixed #11582: Registering with a .mobi email address - fixed #11582: Registering with a .mobi email address
- fixed #11580: Date not populated for Story Archive RSS feed - fixed #11580: Date not populated for Story Archive RSS feed
- fixed #11587: Thingy, no fields and undefined statement handles
7.9.5 7.9.5
- Asset->www_copy now has a progress bar - Asset->www_copy now has a progress bar

View file

@ -3361,14 +3361,16 @@ sequenceNumber');
$p = WebGUI::Paginator->new($self->session,$currentUrl,$thingProperties->{thingsPerPage}, undef, $paginatePage); $p = WebGUI::Paginator->new($self->session,$currentUrl,$thingProperties->{thingsPerPage}, undef, $paginatePage);
my $sth = $self->session->db->read($query) if ! $noFields;
my @visibleResults; my @visibleResults;
if (! $noFields) {
my $sth = $self->session->db->read($query) if ! $noFields;
while (my $result = $sth->hashRef){ while (my $result = $sth->hashRef){
if ($self->canViewThingData($thingId,$result->{thingDataId})){ if ($self->canViewThingData($thingId,$result->{thingDataId})){
push(@visibleResults,$result); push(@visibleResults,$result);
} }
} }
$p->setDataByArrayRef(\@visibleResults) if ! $noFields; }
$p->setDataByArrayRef(\@visibleResults);
$searchResults = $p->getPageData($paginatePage); $searchResults = $p->getPageData($paginatePage);
foreach my $searchResult (@$searchResults){ foreach my $searchResult (@$searchResults){