]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3955 Projects are sometimes displayed many times when using "search" in the...
authorJulien Lancelot <julien.lancelot@gmail.com>
Thu, 22 Nov 2012 11:04:02 +0000 (12:04 +0100)
committerJulien Lancelot <julien.lancelot@gmail.com>
Thu, 22 Nov 2012 11:04:12 +0000 (12:04 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb

index fd165668a9d7252c8d81fb2f50c0119fb826f019..c6da540a90d7b295f07cb33207eccf9bdbdb3d09 100644 (file)
@@ -51,13 +51,17 @@ class RolesController < ApplicationController
 
     @pagination = Api::Pagination.new(params)
     @projects=Project.find(:all,
+                           :select => 'distinct(projects.id),projects.kee,projects.name',
                            :include => ['user_roles','group_roles'],
                            :joins => joins,
                            :conditions => [conditions_sql, conditions_values],
                            :order => 'projects.name',
                            :offset => @pagination.offset,
                            :limit => @pagination.limit)
-    @pagination.count=Project.count(:joins => joins, :conditions => [conditions_sql, conditions_values])
+    @pagination.count=Project.count(
+        :select => 'distinct(projects.id)',
+        :joins => joins,
+        :conditions => [conditions_sql, conditions_values])
   end
 
   def edit_users
index acdbd7ecf4d894f32ec73e357e123108fe6df216..3c5f09a00c597048184fdd4c6f9c510966c73da3 100644 (file)
@@ -74,7 +74,7 @@
       <form action="<%= url_for :action => 'projects', :qualifier => @qualifier -%>" method="GET">
         <input type="hidden" name="qualifier" value="<%= @qualifier -%>"/>
         <input type="text" name="q" value="<%= params[:q] -%>" id="search_text"/>
-        <input type="submit" value="Search" id="search_submit"/>
+        <input type="submit" value="<%= message('search_verb') -%>" id="search_submit"/>
       </form>
     </th>
     <th>Role: Administrators</th>