View | Details | Raw Unified | Return to bug 16586
Collapse All | Expand All

(-)a/Koha/Plugins.pm (-10 / +5 lines)
Lines 21-26 use Modern::Perl; Link Here
21
21
22
use Module::Load::Conditional qw(can_load);
22
use Module::Load::Conditional qw(can_load);
23
use Module::Pluggable search_path => ['Koha::Plugin'], except => qr/::Edifact(|::Line|::Message|::Order|::Segment|::Transport)$/;
23
use Module::Pluggable search_path => ['Koha::Plugin'], except => qr/::Edifact(|::Line|::Message|::Order|::Segment|::Transport)$/;
24
use List::MoreUtils qw( any );
24
25
25
use C4::Context;
26
use C4::Context;
26
use C4::Output;
27
use C4::Output;
Lines 76-92 sub GetPlugins { Link Here
76
            my $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} });
77
            my $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} });
77
78
78
            # Limit results by method or metadata
79
            # Limit results by method or metadata
79
            my $ok = 1;
80
            next if $method && !$plugin->can($method);
80
            next if $method && !$plugin->can($method);
81
            my $plugin_metadata = $plugin->get_metadata;
81
            my $plugin_metadata = $plugin->get_metadata;
82
            foreach my $key ( keys %$req_metadata ) {
82
            next if $plugin_metadata
83
                if( !$plugin_metadata->{$key} ||
83
                and %$req_metadata
84
                  $plugin_metadata->{$key} ne $req_metadata->{$key} ) {
84
                and any { !$plugin_metadata->{$_} || $plugin_metadata->{$_} ne $req_metadata->{$_} } keys %$req_metadata;
85
                    $ok = 0;
85
            push @plugins, $plugin;
86
                    last;
87
                }
88
            }
89
            push( @plugins, $plugin ) if $ok;
90
        }
86
        }
91
    }
87
    }
92
    return @plugins;
88
    return @plugins;
93
- 

Return to bug 16586