From: Simon Brandhof Date: Thu, 18 Oct 2012 09:55:58 +0000 (+0200) Subject: Fix configuration of the widgets that need selection of metrics X-Git-Tag: 3.4~469 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ac3a526637613a6bfef4f74bce39ad8887d71212;p=sonarqube.git Fix configuration of the widgets that need selection of metrics See http://sonar.15.n6.nabble.com/Release-Candidate-of-Sonar-3-3-tp5004192p5004199.html --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index f5c9a89d69c..eb887f649f5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -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],