From: Fabrice Bellingard Date: Fri, 25 May 2012 15:49:39 +0000 (+0200) Subject: SONAR-2706 Rule name can be empty in DB X-Git-Tag: 3.1~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dce02ebac236b4ee51ba045647f17429d007db5f;p=sonarqube.git SONAR-2706 Rule name can be empty in DB --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb index 4cde503c03d..a9d96e1bae5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb @@ -78,7 +78,13 @@ class Rule < ActiveRecord::Base result end else - read_attribute(:name) + @raw_name ||= + begin + result = read_attribute(:name) + # if no name present in the DB, then name is in the English bundle for sure + result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getRuleName("en", repository_key, plugin_rule_key) unless result + result + end end end