Commit 3c94729bc1231c1a23209fc6ca3aeaed5a29534d
1 parent
da84575e
Exists in
master
and in
29 other branches
plugins: revert change on pipeline
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
lib/noosfero/plugin/manager.rb
... | ... | @@ -24,7 +24,7 @@ class Noosfero::Plugin::Manager |
24 | 24 | end |
25 | 25 | |
26 | 26 | def fetch_plugins(event, *args) |
27 | - map { |plugin| plugin.class if result_for plugin, event, *args }.compact.flatten | |
27 | + flat_map{ |plugin| plugin.class if result_for plugin, event, *args }.compact | |
28 | 28 | end |
29 | 29 | |
30 | 30 | def dispatch_without_flatten(event, *args) |
... | ... | @@ -60,7 +60,8 @@ class Noosfero::Plugin::Manager |
60 | 60 | |
61 | 61 | def pipeline(event, *args) |
62 | 62 | each do |plugin| |
63 | - result = result_for plugin, event, *args | |
63 | + # result_for can't be used here and default must be returned to keep args | |
64 | + result = plugin.send event, *args | |
64 | 65 | result = result.kind_of?(Array) ? result : [result] |
65 | 66 | raise ArgumentError, "Pipeline broken by #{plugin.class.name} on #{event} with #{result.length} arguments instead of #{args.length}." if result.length != args.length |
66 | 67 | args = result | ... | ... |
-
mentioned in commit 3e99a558261678f01c6d69b6053d4394adbea68b