]> source.dussan.org Git - sonarqube.git/commitdiff
Fix configuration of the widgets that need selection of metrics
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 18 Oct 2012 09:55:58 +0000 (11:55 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 18 Oct 2012 09:55:58 +0000 (11:55 +0200)
See http://sonar.15.n6.nabble.com/Release-Candidate-of-Sonar-3-3-tp5004192p5004199.html

sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb

index f5c9a89d69c9ad0ce2bd12dae6d380a64879874e..eb887f649f5b72c4ce381e19ce2ecd56fafd146a 100644 (file)
@@ -713,7 +713,12 @@ module ApplicationHelper
       select_tag_prompt=''
     end
 
-    metrics_by_domain=metrics.sort_by(&:short_name).inject({}) { |h, metric| h[metric.domain]||=[]; h[metric.domain]<<[metric.short_name, metric.key]; h }
+    metrics_by_domain=metrics.sort_by(&:short_name).inject({}) do |h, metric|
+      domain=metric.domain||''
+      h[domain]||=[]
+      h[domain]<<[metric.short_name, metric.key]
+      h
+    end
 
     html = select_tag(name, grouped_options_for_select(metrics_by_domain, options[:selected_key], select_tag_prompt),
                       :multiple => options[:multiple],