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

(-)a/Koha/Plugins.pm (-1 / +3 lines)
Lines 26-32 use C4::Context; Link Here
26
use C4::Output;
26
use C4::Output;
27
27
28
BEGIN {
28
BEGIN {
29
    push @INC, C4::Context->config("pluginsdir");
29
    my $pluginsdir = C4::Context->config("pluginsdir");
30
    my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir;
31
    push( @INC, @pluginsdir );
30
}
32
}
31
33
32
=head1 NAME
34
=head1 NAME
(-)a/Koha/Plugins/Handler.pm (-3 / +11 lines)
Lines 26-32 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
    my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir;
31
    push( @INC, @pluginsdir );
30
}
32
}
31
33
32
=head1 NAME
34
=head1 NAME
Lines 79-86 Deletes a plugin Link Here
79
sub delete {
81
sub delete {
80
    my ( $class, $args ) = @_;
82
    my ( $class, $args ) = @_;
81
    my $plugin_class = $args->{'class'};
83
    my $plugin_class = $args->{'class'};
82
    my $plugin_dir   = C4::Context->config("pluginsdir");
84
83
    my $plugin_path  = "$plugin_dir/" . join( '/', split( '::', $args->{'class'} ) );
85
    my $plugin_path = $plugin_class;
86
    $plugin_path =~ s/::/\//g;  # Take class name, transform :: to / to get path
87
    $plugin_path =~ s/$/.pm/;   # Add .pm to the end
88
    require $plugin_path;   # Require the plugin to have it's path listed in INC
89
    $plugin_path =
90
      $INC{$plugin_path};   # Get the full true path to the plugin from INC
91
    $plugin_path =~ s/.pm//;    # Remove the .pm from the end
84
92
85
    Koha::Plugins::Handler->run( { class => $plugin_class, method => 'uninstall' } );
93
    Koha::Plugins::Handler->run( { class => $plugin_class, method => 'uninstall' } );
86
94
(-)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