Skip to content
Browse files

Simple search should search current versions only

[#242 state:resolved]
  • Loading branch information...
1 parent b769e35 commit ea91cc24c8baf00f45007c1e535f12eddcbb52bb @gregheo gregheo committed Jul 26, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/Bric/Biz/Asset/Business/Media.pm
  2. +1 −1 lib/Bric/Biz/Asset/Business/Story.pm
View
2 lib/Bric/Biz/Asset/Business/Media.pm
@@ -281,7 +281,7 @@ use constant PARAM_WHERE_MAP => {
. 'mt.id = mm2.object_id',
simple => 'mt.id IN ('
. 'SELECT mmt.id FROM media mmt '
- . 'JOIN media_instance mi2 ON media__id = mmt.id '
+ . 'JOIN media_instance mi2 ON (media__id = mmt.id AND version = mmt.current_version) '
. 'WHERE LOWER(mi2.name) LIKE LOWER(?) '
. 'OR LOWER(mi2.description) LIKE LOWER(?) '
. 'OR LOWER(mi2.uri) LIKE LOWER(?) '
View
2 lib/Bric/Biz/Asset/Business/Story.pm
@@ -404,7 +404,7 @@ use constant PARAM_WHERE_MAP => {
. 's.id = sm2.object_id',
simple => 's.id IN ('
. 'SELECT ss.id FROM story ss '
- . 'JOIN story_instance si2 ON story__id = ss.id '
+ . 'JOIN story_instance si2 ON (story__id = ss.id AND version = ss.current_version) '
. 'WHERE LOWER(si2.name) LIKE LOWER(?) '
. 'OR LOWER(si2.description) LIKE LOWER(?) '
. 'OR LOWER(si2.primary_uri) LIKE LOWER(?) '

0 comments on commit ea91cc2

Please sign in to comment.
Something went wrong with that request. Please try again.