]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4576 Sometimes some project modules are displayed in the "Bulk Deletion" page...
authorJulien Lancelot <julien.lancelot@gmail.com>
Tue, 20 Aug 2013 15:34:52 +0000 (17:34 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Tue, 20 Aug 2013 15:34:52 +0000 (17:34 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/bulk_deletion_controller.rb

index 57a615ba4305b9d3d110485499498e2a21a0540d..6dc2c3fd0ea2cf61a65de60e2febfc4e28051a98 100644 (file)
@@ -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])