From: Fabrice Bellingard Date: Wed, 14 Mar 2012 11:01:11 +0000 (+0100) Subject: SONAR-3326 Problem displaying History when project has a Green Alert X-Git-Tag: 3.0~203 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a4cd43b090912073a0219a50d3405e6290c99835;p=sonarqube.git SONAR-3326 Problem displaying History when project has a Green Alert --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/event.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/event.rb index 7e8633e313f..a865c3d7aae 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/event.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/event.rb @@ -36,6 +36,12 @@ class Event < ActiveRecord::Base end end + # Use this method to display event description, as missing descriptions are not stored in the same way + # on different DBs (see https://jira.codehaus.org/browse/SONAR-3326) + def description_text + description || '' + end + # # For a given snapshot, checks if an event with the same name & category # exists in the history of the corresponding resource (= in any existing diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb index a0a9f0ecd0f..5f019607b55 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb @@ -133,11 +133,11 @@ - <%= image_tag "event_alert.png", :alt => (message('project_history.col.alert') + ": " + alert_event.name + ". " + alert_event.description) if alert_event -%> + <%= image_tag "event_alert.png", :alt => (message('project_history.col.alert') + ": " + alert_event.name + ". " + alert_event.description_text) if alert_event -%> - <%= image_tag "event_profile.png", :alt => message('project_history.col.profile') + ": " + profile_event.description if profile_event -%> + <%= image_tag "event_profile.png", :alt => message('project_history.col.profile') + ": " + profile_event.description_text if profile_event -%>