summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2025-04-19 07:24:46 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2025-04-19 07:24:46 +0000
commitae566b3bf9bf6e5fe7cb1d532f8c025686a84c40 (patch)
treede85cb8c341a19dced1e6e1b31a52ab7d334c01d
parentde96d418b14aa2f2d58947b8d22d42470cb06028 (diff)
downloadredmine-ae566b3bf9bf6e5fe7cb1d532f8c025686a84c40.tar.gz
redmine-ae566b3bf9bf6e5fe7cb1d532f8c025686a84c40.zip
Fixes plugin activity SVG icons broken when multiple plugins are loaded (#42509).
Patch by Stefan Rinkes (user:srinkes). git-svn-id: https://svn.redmine.org/redmine/trunk@23683 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/activities/_activities.html.erb2
-rw-r--r--lib/redmine/activity.rb15
2 files changed, 10 insertions, 7 deletions
diff --git a/app/views/activities/_activities.html.erb b/app/views/activities/_activities.html.erb
index 21ec1fb28..f2d8e22bd 100644
--- a/app/views/activities/_activities.html.erb
+++ b/app/views/activities/_activities.html.erb
@@ -4,7 +4,7 @@
<dl>
<% sort_activity_events(events_by_day[day]).each do |e, in_group| -%>
<dt class="<%= e.event_type %> icon icon-<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
- <%= activity_event_type_icon e.event_type, plugin: Redmine::Activity.plugin_name(e.activity_provider_options.keys[0]) %>
+ <%= activity_event_type_icon e.event_type, plugin: Redmine::Activity.plugin_name(e.class) %>
<%= avatar(e.event_author) if e.respond_to?(:event_author) %>
<span class="time"><%= format_time(e.event_datetime, false) %></span>
<%= content_tag('span', e.project, :class => 'project') if @project.nil? || @project != e.project %>
diff --git a/lib/redmine/activity.rb b/lib/redmine/activity.rb
index 826b81c9e..3189f4fb1 100644
--- a/lib/redmine/activity.rb
+++ b/lib/redmine/activity.rb
@@ -19,11 +19,11 @@
module Redmine
module Activity
- mattr_accessor :available_event_types, :default_event_types, :plugins_event_types, :providers
+ mattr_accessor :available_event_types, :default_event_types, :plugins_event_classes, :providers
@@available_event_types = []
@@default_event_types = []
- @@plugins_event_types = {}
+ @@plugins_event_classes = {}
@@providers = Hash.new {|h, k| h[k]=[]}
class << self
@@ -41,19 +41,22 @@ module Redmine
@@available_event_types << event_type unless @@available_event_types.include?(event_type)
@@default_event_types << event_type unless options[:default] == false
- @@plugins_event_types = { event_type => options[:plugin].to_s } unless options[:plugin].nil?
+ if options[:plugin]
+ providers.each do | provider |
+ @@plugins_event_classes[provider] = options[:plugin].to_s
+ end
+ end
@@providers[event_type] += providers
end
def delete(event_type)
@@available_event_types.delete event_type
@@default_event_types.delete event_type
- @@plugins_event_types.delete(event_type)
@@providers.delete(event_type)
end
- def plugin_name(event_type)
- @@plugins_event_types[event_type]
+ def plugin_name(class_name)
+ @@plugins_event_classes[class_name.to_s]
end
end
end