diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-09 16:08:41 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-09 16:10:48 +0200 |
commit | ee7c546c56fa295eca2c3af77117fc07f08e26a9 (patch) | |
tree | f791c63ce1a0f310b651dd51beb2b322e9e2349c | |
parent | 162f373c4404c9605a2ab069ec85045518585497 (diff) | |
download | sonarqube-ee7c546c56fa295eca2c3af77117fc07f08e26a9.tar.gz sonarqube-ee7c546c56fa295eca2c3af77117fc07f08e26a9.zip |
SONAR-3838 The widget "Most violated resources" generates an exception when used on a "Developer" resource
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb index c3cde4869f1..c377a0cdd9c 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb @@ -9,7 +9,7 @@ snapshots_values[:root_sid] = (@snapshot.root_snapshot_id || @snapshot.id) snapshots_values[:path]="#{@snapshot.path}#{@snapshot.id}.%" - measures_conditions = ["project_measures.rule_id IS NULL", "project_measures.characteristic_id IS NULL", "project_measures.person_id IS NULL"] + measures_conditions = ["project_measures.rule_id IS NULL AND project_measures.characteristic_id IS NULL AND project_measures.person_id IS NULL"] measures_values = {} measures_conditions << "project_measures.metric_id = :m_id" measures_values[:m_id] = metric.id @@ -19,6 +19,7 @@ :conditions => [(snapshots_conditions + measures_conditions).join(' AND '), snapshots_values.merge(measures_values)], :order => "project_measures.value #{'DESC' if metric.direction<0}", :limit => limit) + measures=measures.select{|m| m.text_value.present?} snapshots=Snapshot.find(measures.map { |m| m.snapshot_id }, :include => 'project') snapshots_by_id = {} |