From: Jean-Baptiste Lievremont Date: Tue, 7 Oct 2014 14:23:35 +0000 (+0200) Subject: SONAR-5575 Correctly send empty parameter values when modifying a custom rule X-Git-Tag: 4.5.1-RC1~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=36b2b7e2dd6359b58e77052bd2557d0107f1a9b0;p=sonarqube.git SONAR-5575 Correctly send empty parameter values when modifying a custom rule --- diff --git a/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-custom-rule-creation-view.coffee b/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-custom-rule-creation-view.coffee index 810f4ccfd89..4728cb45e5b 100644 --- a/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-custom-rule-creation-view.coffee +++ b/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-custom-rule-creation-view.coffee @@ -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)