aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-04-02 19:30:57 +0200
committerFabrice Bellingard <bellingard@gmail.com>2012-04-02 19:31:40 +0200
commitd97b49ea30e08c3bf820009a9866a378c5b7a846 (patch)
treebdb055d16493bc5d31fa6fca6bdce791f6698980 /sonar-server
parent6148bb0cd6d0f33b66b611a7f85061d33c829f0d (diff)
downloadsonarqube-d97b49ea30e08c3bf820009a9866a378c5b7a846.tar.gz
sonarqube-d97b49ea30e08c3bf820009a9866a378c5b7a846.zip
SONAR-3368 Error log "ActiveRecord::JDBCError: Unknown column 'project_measures.variation_value_0'"
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
index 1cf169d98c8..4db519bdda8 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
@@ -48,7 +48,7 @@ class DrilldownController < ApplicationController
@characteristic=Characteristic.find(:first, :select => 'id', :include => 'quality_model', :conditions => ['quality_models.name=? AND characteristics.kee=? AND characteristics.enabled=?', params[:model], params[:characteristic], true])
end
options[:characteristic]=@characteristic
- if params[:period]
+ if params[:period] && Api::Utils.valid_period_index?(params[:period])
@period=params[:period].to_i
options[:period]=@period
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb
index e8a6b4038a0..bb6c2034e7d 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb
@@ -124,4 +124,11 @@ class Api::Utils
end
end
end
+
+ #
+ # Since Sonar 2.15
+ #
+ def self.valid_period_index?(index)
+ Api::Utils.is_integer?(index) && index.to_i > 0 && index.to_i <6
+ end
end