Handle the edge case where no fields are to be returned in a Thingy search. Fixes bug #11587
This commit is contained in:
parent
7a1487be55
commit
9cfcf84c2f
2 changed files with 10 additions and 7 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -3357,18 +3357,20 @@ sequenceNumber');
|
||||||
WebGUI::Cache->new($self->session,"query_".$thingId)->set($query,30*60);
|
WebGUI::Cache->new($self->session,"query_".$thingId)->set($query,30*60);
|
||||||
|
|
||||||
$paginatePage = $self->session->form->param('pn') || 1;
|
$paginatePage = $self->session->form->param('pn') || 1;
|
||||||
$currentUrl = $self->session->url->append($currentUrl, "orderBy=".$orderBy) if $orderBy;
|
$currentUrl = $self->session->url->append($currentUrl, "orderBy=".$orderBy) if $orderBy;
|
||||||
|
|
||||||
$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;
|
||||||
while (my $result = $sth->hashRef){
|
if (! $noFields) {
|
||||||
if ($self->canViewThingData($thingId,$result->{thingDataId})){
|
my $sth = $self->session->db->read($query) if ! $noFields;
|
||||||
push(@visibleResults,$result);
|
while (my $result = $sth->hashRef){
|
||||||
|
if ($self->canViewThingData($thingId,$result->{thingDataId})){
|
||||||
|
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){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue