]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5575 Correctly send empty parameter values when modifying a custom rule
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 7 Oct 2014 14:23:35 +0000 (16:23 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Thu, 9 Oct 2014 07:40:44 +0000 (09:40 +0200)
server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-custom-rule-creation-view.coffee

index 810f4ccfd898ddc84a5c060ab8fb0719e4d76ed2..4728cb45e5ba1b117f827e29b1b4ef014f24aec0 100644 (file)
@@ -68,7 +68,11 @@ define [
         postData.prevent_reactivation = true
 
       params = @ui.customRuleCreationParameters.map(->
-        key: jQuery(@).prop('name'), value: jQuery(@).val() || jQuery(@).prop('placeholder') || '').get()
+        node = jQuery(@)
+        value = node.val()
+        if !value and action == 'create'
+          value = node.prop('placeholder') || ''
+        key: node.prop('name'), value: value).get()
 
       postData.params = (params.map (param) -> param.key + '=' + param.value).join(';')
       @sendRequest(action, postData)