From 021c6b52ada918771b1f68ad8162bc37bb7dbc0a Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 22 Nov 2012 12:04:02 +0100 Subject: [PATCH] SONAR-3955 Projects are sometimes displayed many times when using "search" in the roles view --- .../main/webapp/WEB-INF/app/controllers/roles_controller.rb | 6 +++++- .../main/webapp/WEB-INF/app/views/roles/projects.html.erb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb index fd165668a9d..c6da540a90d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb @@ -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 diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb index acdbd7ecf4d..3c5f09a00c5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb @@ -74,7 +74,7 @@
- +
Role: Administrators -- 2.39.5