Bug 42551: Skip preload when running perl with -c

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Kyle M Hall 2026-05-07 12:14:25 +00:00 committed by Lucas Gass
parent 8ef30ca3fb
commit 1648db7a84
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 2 additions and 1 deletions

View File

@ -47,9 +47,10 @@ BEGIN {
pop @INC if $INC[-1] eq '.';
# Load plugins early to ensure they're available before any transactions begin
# Skip under "perl -c" to avoid C3 error when syntax checking plugins
my $enable_plugins = C4::Context->config("enable_plugins") // 0;
if ($enable_plugins) {
if ( $enable_plugins && !$^C ) {
require Koha::Plugins::Loader;
Koha::Plugins::Loader->get_enabled_plugins();
}