changeset 996:c43450d54787 bug_494

Fix bug 494, Tag search doesn't work for tagged subprojects whose parents lack the tag
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 09 Nov 2012 13:57:53 +0000
parents f9a882232e2d
children c1b8a34d3560 c4436fec34bf
files vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb	Fri Nov 09 13:57:39 2012 +0000
+++ b/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb	Fri Nov 09 13:57:53 2012 +0000
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 require_dependency 'projects_controller'
 
 module RedmineTags
@@ -127,13 +128,10 @@
           end
   
           unless @tag_list.empty?
-            @tagged_projects_ids = Project.visible.tagged_with(@tag_list).collect{ |project| Project.find(project.id) }
+            @tagged_projects_ids = Project.visible.tagged_with(@tag_list).collect{ |project| Project.find(project.id).root }
             @projects = @projects & @tagged_projects_ids
+            @projects = @projects.uniq
           end
-          
-          @projects = @projects.collect{ |project| project.root }
-          @projects = @projects.uniq
-                    
         end
       end
     end