Dates in the galley advanced search were ignored.

This commit is contained in:
Colin Kuskie 2009-02-04 16:58:25 +00:00
parent a5ad3bf4bd
commit 62a14a2dcc
2 changed files with 19 additions and 5 deletions

View file

@ -18,6 +18,7 @@
- fixed #9623: preload.custom paths not included during upgrade
- fixed #9638: Survey - Submit of survey creates new demo
- fixed #9669: Folder: synopsis var of a subfolder broken
- fixed #9658: gallery advanced search dates do not work
7.6.10
- fixed #9577: WebGUI::Form::Url::getValue returns blank rather than undef for blank fields

View file

@ -1349,11 +1349,13 @@ sub www_search {
if ( $doSearch ) {
# Keywords to search on
my $keywords = join " ", $form->get('basicSearch'),
$form->get('keywords'),
$form->get('title'),
$form->get('description')
;
# Do not add a space to the
my $keywords;
FORMVAR: foreach my $formVar (qw/ basicSearch keywords title description /) {
my $var = $form->get($formVar);
next FORMVAR unless $var;
$keywords = join ' ', $keywords, $var;
}
# Build a where clause from the advanced options
# Lineage search can capture gallery
@ -1374,6 +1376,16 @@ sub www_search {
;
}
my $dateAfter = $form->get("creationDate_after", "dateTime");
my $dateBefore = $form->get("creationDate_before", "dateTime");
my $creationDate = {};
if ($dateAfter) {
$creationDate->{start} = $dateAfter;
}
if ($dateBefore) {
$creationDate->{end } = $dateBefore;
}
# Classes
my $joinClass = [
'WebGUI::Asset::Wobject::GalleryAlbum',
@ -1407,6 +1419,7 @@ sub www_search {
keywords => $keywords,
where => $where,
joinClass => $joinClass,
creationDate => $creationDate,
} );
$var->{ keywords } = $keywords;