Bug 25131: (QA follow-up) Move test for needs_install outside the plugin

This follow-up patch moves the check outside the register routine. The
Mojo plugin won't be loaded unless there's no need to install.

As the original tests rely on V1.pm to be able to load the plugin, they
are still valid, and they should still pass as there's no behaviour
change.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Tomas Cohen Arazi 2020-04-15 11:48:23 -03:00 committed by Martin Renvoize
parent be618ab400
commit 75f3cb5680
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 3 additions and 4 deletions

View File

@ -45,8 +45,7 @@ sub register {
my @plugins;
if ( C4::Context->config("enable_plugins") and
! C4::Context->needs_install ) # Koha is installed
if ( C4::Context->config("enable_plugins") )
{
# plugin needs to define a namespace
@plugins = Koha::Plugins->new()->GetPlugins(

View File

@ -86,7 +86,7 @@ sub startup {
spec => $spec,
validator => undef
}
);
) unless C4::Context->needs_install; # load only if Koha is installed
$self->plugin(
OpenAPI => {
@ -115,7 +115,7 @@ sub startup {
spec => $spec,
validator => $validator
}
);
) unless C4::Context->needs_install; # load only if Koha is installed
$self->plugin(
OpenAPI => {