diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-09-15 14:19:56 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-09-16 11:31:45 +0200 |
commit | 9ce1f45d9d72e66a68c0614847b813a2e55d77b2 (patch) | |
tree | 1ccc5cd474f14b3db523cce0d3a3fa808513fccc /server/sonar-web | |
parent | fc8e38bb33581bba60be1ef1403488051c0686fb (diff) | |
download | sonarqube-9ce1f45d9d72e66a68c0614847b813a2e55d77b2.tar.gz sonarqube-9ce1f45d9d72e66a68c0614847b813a2e55d77b2.zip |
SONAR-7676 fix cast error calling java_facade.saveProperty
Diffstat (limited to 'server/sonar-web')
3 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb index d3bb3d70cad..8e8fee2d57f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb @@ -54,7 +54,7 @@ class AccountController < ApplicationController project_notifs.each do |r_id, per_project_notif| per_project_notif.each do |dispatch, channels| channels.each do |channel, value| - Api::Utils.java_facade.saveProperty('notification.' + dispatch + '.' + channel, r_id, current_user.id, 'true') + Api::Utils.java_facade.saveProperty('notification.' + dispatch + '.' + channel, r_id.to_i, current_user.id, 'true') end end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb index 1be65ebedba..9971150b7b1 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb @@ -135,7 +135,7 @@ class Api::PropertiesController < Api::ApiController not_found('resource not found') end end - Api::Utils.java_facade.saveProperty(key, resource_id_or_key, nil, nil) + Api::Utils.java_facade.saveProperty(key, resource_id_or_key.nil? ? nil : resource_id_or_key.to_i, nil, nil) render_success('property deleted') end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/property.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/property.rb index 225896f3129..ed1b86f2b18 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/property.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/property.rb @@ -55,7 +55,7 @@ class Property < ActiveRecord::Base def self.clear(key, resource_id=nil, user_id=nil) prop = by_key(key, resource_id, user_id) if prop - Api::Utils.java_facade.saveProperty(key, resource_id, user_id, nil) + Api::Utils.java_facade.saveProperty(key, resource_id.nil? ? nil : resource_id.to_i, user_id, nil) end prop end @@ -124,7 +124,7 @@ class Property < ActiveRecord::Base end # create/update property in DB - Api::Utils.java_facade.saveProperty(key, resource_id, user_id, raw_value) + Api::Utils.java_facade.saveProperty(key, resource_id.nil? ? nil : resource_id.to_i, user_id, raw_value) # update returned property if raw_value.nil? |