diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-08-14 10:42:10 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-08-14 10:42:10 +0200 |
commit | fe555ba3ab25c687afdbab51bdb51110d17c2056 (patch) | |
tree | cbde9f2b47d5bd1aff22a8e72768b20bb2f851b7 /sonar-server/src | |
parent | 6bb071bb05dff93deeda06b6b34f7b7305f30f2e (diff) | |
download | sonarqube-fe555ba3ab25c687afdbab51bdb51110d17c2056.tar.gz sonarqube-fe555ba3ab25c687afdbab51bdb51110d17c2056.zip |
SONAR-4568 Fix issue when updating rule param value many times
Diffstat (limited to 'sonar-server/src')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb index b0b9dab8659..02c2d6f89e7 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb @@ -311,7 +311,8 @@ class RulesConfigurationController < ApplicationController profile = Profile.find(params[:profile_id].to_i) rule_param = RulesParameter.find(params[:param_id].to_i) active_rule = ActiveRule.find(params[:active_rule_id].to_i) - active_param = ActiveRuleParameter.find(params[:id].to_i) if params[:id].to_i > 0 + # As the active param can be null, we should not raise a RecordNotFound exception when it's not found (as it would be done when using find(:id) function) + active_param = ActiveRuleParameter.first(params[:id].to_i) if params[:id].to_i > 0 value = params[:value] if value != "" active_param = ActiveRuleParameter.new(:rules_parameter => rule_param, :active_rule => active_rule) if active_param.nil? @@ -324,7 +325,6 @@ class RulesConfigurationController < ApplicationController elsif !active_param.nil? old_value = active_param.value active_param.destroy - active_param = nil java_facade.ruleParamChanged(profile.id, active_rule.id, rule_param.name, old_value, nil, current_user.name) end |