Browse Source

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>
20.05.x
Tomás Cohen Arazi 4 years ago
committed by Martin Renvoize
parent
commit
75f3cb5680
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 3
      Koha/REST/Plugin/PluginRoutes.pm
  2. 4
      Koha/REST/V1.pm

3
Koha/REST/Plugin/PluginRoutes.pm

@ -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(

4
Koha/REST/V1.pm

@ -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 => {

Loading…
Cancel
Save