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

(-)a/C4/Context.pm (-13 lines)
Lines 22-40 use Modern::Perl; Link Here
22
use vars qw($AUTOLOAD $context);
22
use vars qw($AUTOLOAD $context);
23
23
24
BEGIN {
24
BEGIN {
25
    # Load plugins early to ensure they're available before any transactions begin
26
    my $enable_plugins = 0;
27
    if ( exists $ENV{'KOHA_CONF'} && -e $ENV{'KOHA_CONF'} ) {
28
        require Koha::Config;
29
        my $config = Koha::Config->get_instance;
30
        $enable_plugins = $config->get('enable_plugins') // 0;
31
    }
32
33
    if ($enable_plugins) {
34
        require Koha::Plugins::Loader;
35
        Koha::Plugins::Loader->get_enabled_plugins();
36
    }
37
38
    if ( $ENV{'HTTP_USER_AGENT'} ) {    # Only hit when plack is not enabled
25
    if ( $ENV{'HTTP_USER_AGENT'} ) {    # Only hit when plack is not enabled
39
26
40
        # Redefine multi_param if cgi version is < 4.08
27
        # Redefine multi_param if cgi version is < 4.08
(-)a/Koha/Plugins.pm (-1 / +9 lines)
Lines 45-50 BEGIN { Link Here
45
    my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir;
45
    my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir;
46
    push @INC, array_minus( @pluginsdir, @INC );
46
    push @INC, array_minus( @pluginsdir, @INC );
47
    pop @INC if $INC[-1] eq '.';
47
    pop @INC if $INC[-1] eq '.';
48
49
    # Load plugins early to ensure they're available before any transactions begin
50
    my $enable_plugins = C4::Context->config("enable_plugins") // 0;
51
52
    if ($enable_plugins) {
53
        require Koha::Plugins::Loader;
54
        Koha::Plugins::Loader->get_enabled_plugins();
55
    }
56
48
}
57
}
49
58
50
=head1 NAME
59
=head1 NAME
51
- 

Return to bug 38384