Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Ensure the payload sent to notifications is a hash (#9253)

Oliver Günther9547d28e95e2
diff --git a/lib/open_project/notifications.rb b/lib/open_project/notifications.rb
index 60cf6368fd9..7805233e483 100644
--- a/lib/open_project/notifications.rb
+++ b/lib/open_project/notifications.rb
@@ -53,8 +53,8 @@ module OpenProject
end
end
- sub = ActiveSupport::Notifications.subscribe(name.to_s) do |_, _, _, _, payload|
- block.call(payload)
+ sub = ActiveSupport::Notifications.subscribe(name.to_s) do |_, _, _, _, data|
+ block.call(data.fetch(:payload, data))
end
subs = clear_subscriptions ? [] : Array(subscriptions[name])
@@ -78,7 +78,7 @@ module OpenProject
# delivered (although it is not at the moment), so don't count on object equality
# for the payload.
def send(name, payload)
- ActiveSupport::Notifications.instrument(name.to_s, payload)
+ ActiveSupport::Notifications.instrument(name.to_s, payload: payload)
end
def subscriptions