From: Julien Lancelot Date: Tue, 20 Aug 2013 15:34:52 +0000 (+0200) Subject: SONAR-4576 Sometimes some project modules are displayed in the "Bulk Deletion" page... X-Git-Tag: 3.7.1-RC1-~68 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f0e6b03700bbbd318b7582d77a65817a911d08d4;p=sonarqube.git SONAR-4576 Sometimes some project modules are displayed in the "Bulk Deletion" page and can't be removed --- 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])