From 24a0d0318cc9379bd22a77387c2d2fd961f04402 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 12 Jun 2012 14:51:06 +0200 Subject: [PATCH] SONAR-2073 fix selection of metrics in filter treemaps --- .../main/webapp/WEB-INF/app/controllers/treemap_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/treemap_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/treemap_controller.rb index eda7f53536b..46ec74f4e8c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/treemap_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/treemap_controller.rb @@ -37,7 +37,8 @@ class TreemapController < ApplicationController size_metric=Metric.by_key(params[:size_metric]||'lines') bad_request('Unknown metric: ' + params[:size_metric]) unless size_metric - color_metric=(params[:color_metric].present? ? Metric.by_key(params[:color_metric]) : nil) + color_metric=Metric.by_key(params[:color_metric]) + bad_request('Unknown metric: ' + params[:color_metric]) unless color_metric if params[:resource] resource = Project.by_key(params[:resource]) @@ -51,6 +52,7 @@ class TreemapController < ApplicationController bad_request('Unknown filter: ' + params[:filter]) unless filter access_denied unless filter.authorized_to_execute?(self) filter.sorted_column=FilterColumn.new('family' => 'metric', :kee => size_metric.key, :sort_direction => (size_metric.direction>=0 ? 'ASC' : 'DESC')) + params[:metric_ids]=[size_metric.id, color_metric.id] filter_context=Filters.execute(filter, self, params) else bad_request('Missing parameter: resource or filter') -- 2.39.5