From dce02ebac236b4ee51ba045647f17429d007db5f Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Fri, 25 May 2012 17:49:39 +0200 Subject: [PATCH] SONAR-2706 Rule name can be empty in DB --- sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.5