diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f00afcc27..31fbcffa4 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -35,7 +35,7 @@ - fixed: I need a template for this display - fixed: If a user clicks on an unsubscribe link in an email and they are not logged into WebGUI, they are now prompted to log in so that they can then unsbscribe. - fixed: Using a password recovery token a second time informs the user of the reuse instead of having a style inside a style with a login form. - + - fixed: Thingy Things can now have no fields and still be functional. 7.5.22 - fixed: Layout template now gets prepared correctly - fixed: When user does not have permissions to search/edit a thing a proper error is shown. diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index e7a46f86c..7031c2dce 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -2482,7 +2482,7 @@ sequenceNumber'); }); } } - + my $noFields = 0; if (scalar(@displayInSearchFields)){ $query = "select thingDataId, "; $query .= join(", ",map {$dbh->quote_identifier('field_'.$_->{fieldId})} @displayInSearchFields); @@ -2494,7 +2494,7 @@ sequenceNumber'); } else{ $self->session->errorHandler->warn("The default Thing has no fields selected to display in the search."); - return undef; + $noFields = 1; } # store query in cache for thirty minutes @@ -2504,7 +2504,7 @@ sequenceNumber'); $currentUrl .= ";orderBy=".$orderBy if ($orderBy); $p = WebGUI::Paginator->new($self->session,$currentUrl,$thingProperties->{thingsPerPage}, undef, $paginatePage); - $p->setDataByQuery($query); + $p->setDataByQuery($query) if ! $noFields; $searchResults = $p->getPageData($paginatePage); foreach my $searchResult (@$searchResults){ my (@field_loop);