From: David Gageot Date: Thu, 20 Sep 2012 15:48:04 +0000 (+0200) Subject: SONAR-3754 FIX for standard fields containing comas X-Git-Tag: 3.3~269 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b1a6437a3bfddcb5b9635ebe6a1a984d6f9af0ce;p=sonarqube.git SONAR-3754 FIX for standard fields containing comas --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/property.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/property.rb index 39f617657ee..23d9d2f250d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/property.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/property.rb @@ -65,8 +65,15 @@ class Property < ActiveRecord::Base end def self.set(key, value, resource_id=nil, user_id=nil) - if value.kind_of? Array - value = value.map { |v| v.gsub(',', '%2C') }.join(',') + definition = Java::OrgSonarServerUi::JRubyFacade.getInstance().propertyDefinitions.get(key) + if definition && definition.multi_values + if value.kind_of? Array + value = value.map { |v| v.gsub(',', '%2C') }.join(',') + end + else + if value.kind_of? Array + value = value.first + end end text_value = (value.nil? ? nil : value.to_s)