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

(-)a/Koha/Plugins.pm (-1 / +3 lines)
Lines 27-33 use C4::Context; Link Here
27
use C4::Output;
27
use C4::Output;
28
28
29
BEGIN {
29
BEGIN {
30
    push @INC, C4::Context->config("pluginsdir");
30
    my $pluginsdir = C4::Context->config("pluginsdir");
31
    my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir;
32
    push( @INC, @pluginsdir );
31
    pop @INC if $INC[-1] eq '.';
33
    pop @INC if $INC[-1] eq '.';
32
}
34
}
33
35
(-)a/Koha/Plugins/Handler.pm (-4 / +12 lines)
Lines 26-33 use Module::Load::Conditional qw(can_load); Link Here
26
use C4::Context;
26
use C4::Context;
27
27
28
BEGIN {
28
BEGIN {
29
    push @INC, C4::Context->config("pluginsdir");
29
    my $pluginsdir = C4::Context->config("pluginsdir");
30
     pop @INC if $INC[-1] eq '.' ;
30
    my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir;
31
    push( @INC, @pluginsdir );
32
    pop @INC if $INC[-1] eq '.' ;
31
}
33
}
32
34
33
=head1 NAME
35
=head1 NAME
Lines 83-90 sub delete { Link Here
83
    return unless ( C4::Context->config("enable_plugins") || $args->{'enable_plugins'} );
85
    return unless ( C4::Context->config("enable_plugins") || $args->{'enable_plugins'} );
84
86
85
    my $plugin_class = $args->{'class'};
87
    my $plugin_class = $args->{'class'};
86
    my $plugin_dir   = C4::Context->config("pluginsdir");
88
87
    my $plugin_path  = "$plugin_dir/" . join( '/', split( '::', $args->{'class'} ) );
89
    my $plugin_path = $plugin_class;
90
    $plugin_path =~ s/::/\//g;  # Take class name, transform :: to / to get path
91
    $plugin_path =~ s/$/.pm/;   # Add .pm to the end
92
    require $plugin_path;   # Require the plugin to have it's path listed in INC
93
    $plugin_path =
94
      $INC{$plugin_path};   # Get the full true path to the plugin from INC
95
    $plugin_path =~ s/.pm//;    # Remove the .pm from the end
88
96
89
    Koha::Plugins::Handler->run({
97
    Koha::Plugins::Handler->run({
90
        class          => $plugin_class,
98
        class          => $plugin_class,
(-)a/plugins/plugins-upload.pl (-1 / +1 lines)
Lines 56-61 my %errors; Link Here
56
if ($plugins_enabled) {
56
if ($plugins_enabled) {
57
    if ( ( $op eq 'Upload' ) && $uploadfile ) {
57
    if ( ( $op eq 'Upload' ) && $uploadfile ) {
58
        my $plugins_dir = C4::Context->config("pluginsdir");
58
        my $plugins_dir = C4::Context->config("pluginsdir");
59
        $plugins_dir = ref($plugins_dir) eq 'ARRAY' ? $plugins_dir->[0] : $plugins_dir;
59
60
60
        my $dirname = File::Temp::tempdir( CLEANUP => 1 );
61
        my $dirname = File::Temp::tempdir( CLEANUP => 1 );
61
        $debug and warn "dirname = $dirname";
62
        $debug and warn "dirname = $dirname";
62
- 

Return to bug 15879