diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b821558fe..2ef97606f 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -96,6 +96,7 @@ - fixed: Gallery Search form doesn't work right in IE6 - fixed: Password Recovery now only works for Active users and does not allow deactivated users to log in + - fixed: Gallery Search now correctly limits by class name 7.5.10 - fix: Syntax error in GetCsMail diff --git a/lib/WebGUI/Asset/Wobject/Gallery.pm b/lib/WebGUI/Asset/Wobject/Gallery.pm index 6f97ea098..30c367dac 100644 --- a/lib/WebGUI/Asset/Wobject/Gallery.pm +++ b/lib/WebGUI/Asset/Wobject/Gallery.pm @@ -1029,6 +1029,7 @@ sub www_search { ; } + # Classes my $joinClass = [ 'WebGUI::Asset::Wobject::GalleryAlbum', 'WebGUI::Asset::File::GalleryFile::Photo', @@ -1036,6 +1037,8 @@ sub www_search { if ( $form->get("className") ) { $joinClass = [ $form->get('className') ]; } + $where .= q{ AND assetIndex.className IN ( } . $db->quoteAndJoin( $joinClass ) . q{ ) }; + # Build a URL for the pagination my $url @@ -1045,11 +1048,13 @@ sub www_search { . 'keywords=' . $form->get('keywords') . ';' . 'title=' . $form->get('title') . ';' . 'description=' . $form->get('description') . ';' - . 'className=' . $form->get('className') . ';' . 'creationDate_after=' . $form->get('creationDate_after') . ';' . 'creationDate_before=' . $form->get('creationDate_before') . ';' . 'userId=' . $form->get("userId") . ';' ); + for my $class ( @$joinClass ) { + $url .= 'className=' . $class . ';'; + } my $p = $self->getSearchPaginator( {