From f0e6b03700bbbd318b7582d77a65817a911d08d4 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 20 Aug 2013 17:34:52 +0200 Subject: [PATCH] SONAR-4576 Sometimes some project modules are displayed in the "Bulk Deletion" page and can't be removed --- .../WEB-INF/app/controllers/bulk_deletion_controller.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb index 57a615ba430..6dc2c3fd0ea 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb @@ -35,15 +35,12 @@ class BulkDeletionController < ApplicationController @selected_tab = 'TRK' unless @tabs.include?(@selected_tab) # Search for resources having snapshot with islast column to true - conditions = "resource_index.qualifier=:qualifier AND snapshots.islast=:islast" - values = {:qualifier => @selected_tab, :islast => true} + conditions = "resource_index.qualifier=:qualifier AND projects.qualifier=:qualifier AND projects.enabled=:enabled AND snapshots.islast=:islast" + values = {:qualifier => @selected_tab, :enabled => true, :islast => true} if params[:name_filter] && !params[:name_filter].blank? conditions += " AND resource_index.kee LIKE :kee" values[:kee] = params[:name_filter].strip.downcase + '%' end - - conditions += " AND projects.enabled=:enabled" - values[:enabled] = true @resources = Project.all(:select => 'distinct(resource_index.resource_id),projects.id,projects.name,projects.kee,projects.long_name', :conditions => [conditions, values], :joins => [:resource_index, :snapshots]) -- 2.39.5