]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3326 Problem displaying History when project has a Green Alert
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 14 Mar 2012 11:01:11 +0000 (12:01 +0100)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 14 Mar 2012 11:02:04 +0000 (12:02 +0100)
sonar-server/src/main/webapp/WEB-INF/app/models/event.rb
sonar-server/src/main/webapp/WEB-INF/app/views/project/history.html.erb

index 7e8633e313f69c1d5942f0e88cbc1de3aa082416..a865c3d7aae121bc7f7dc601988a706cbe27fcc4 100644 (file)
@@ -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 
index a0a9f0ecd0f07bfa99562f1c8061d4ce37519e0f..5f019607b5505f674e93d122f2a499a60b9b9b23 100644 (file)
       </td>
 
       <td class="thin nowrap">
-        <%= 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 -%>
       </td>
 
       <td class="thin nowrap">
-        <%= 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 -%>
       </td>
 
       <td class="thin nowrap center" style="padding-left:10px; padding-right:10px">