aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-07-17 15:11:47 +0200
committerDavid Gageot <david@gageot.net>2012-07-17 15:11:58 +0200
commit81d6e63471746864fea2d05bb15186c0ad37dbfd (patch)
tree085997b1bf365464400ebc1237cb22b86cd203d8
parent271bfcbb46f87cddac93072edcfeeae41e633aa6 (diff)
downloadsonarqube-81d6e63471746864fea2d05bb15186c0ad37dbfd.tar.gz
sonarqube-81d6e63471746864fea2d05bb15186c0ad37dbfd.zip
SONAR-3665 Boolean widget properties are not saved when editing a widget
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb
index 65fb7cc3ebd..9e4eb3e29ae 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb
@@ -30,7 +30,7 @@ module PropertiesHelper
password_field_tag key, value, {:size => 25}.update(options)
elsif type==PropertyType::TYPE_BOOLEAN
- check_box_tag key, "true", value=='true', options
+ (hidden_field_tag key, 'false', options) + (check_box_tag key, 'true', value=='true', options)
elsif type==PropertyType::TYPE_INTEGER
text_field_tag key, value, {:size => 10}.update(options)
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb
index d19fe776114..9ac91abcbac 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb
@@ -21,7 +21,7 @@ module WidgetPropertiesHelper
include PropertiesHelper
def property_value_field(definition, value)
- property_value definition.key(), definition.type.name(), value || definition.defaultValue()
+ property_value definition.key(), definition.type.name(), value.nil? ? definition.defaultValue() : value
end
def resource_value_field(value)