Bugzilla – Attachment 102943 Details for
Bug 25131
Web installer broken if enable_plugin is set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25131: Skip loading API plugins if Koha is not installed
Bug-25131-Skip-loading-API-plugins-if-Koha-is-not-.patch (text/plain), 2.16 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-04-14 19:33:09 UTC
(
hide
)
Description:
Bug 25131: Skip loading API plugins if Koha is not installed
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-04-14 19:33:09 UTC
Size:
2.16 KB
patch
obsolete
>From e1792f9f244ecd6914a751c63974b7f3e2af4872 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 14 Apr 2020 16:24:38 -0300 >Subject: [PATCH] Bug 25131: Skip loading API plugins if Koha is not installed > >This patch adds a check on Koha being actually installed to the >PluginRoutes Mojolicious plugin. > >If Koha is not installed, plugin routes won't be tried to get installed. >This has the effect of making the webinstaller functional again (when >enable_plugins is set to 1). > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t >=> FAIL: Tests fail! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Reset your working branch >6. Delete your database (e.g. in koha-testing-docker): > $ mysql -hdb -ppassword > > DROP DATABASE koha_kohadev; > > CREATE DATABASE koha_kohadev; \q >7. Set enable_plugins to 1 in koha-conf.xml >8. Restart all: > $ service memcached restart > $ koha-plack --restart kohadev >9. Open the staff interface >=> FAIL: Hangs, the logs show nasty errors (koha-plack-err) >10. Apply this patches >11. Restart all >12. Repeat 10 >=> SUCCESS: The web installer shows up :-D >13. Sign off :-D >--- > Koha/REST/Plugin/PluginRoutes.pm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/Plugin/PluginRoutes.pm b/Koha/REST/Plugin/PluginRoutes.pm >index 13e267be56..67ff2ae1cf 100644 >--- a/Koha/REST/Plugin/PluginRoutes.pm >+++ b/Koha/REST/Plugin/PluginRoutes.pm >@@ -45,7 +45,8 @@ sub register { > > my @plugins; > >- if ( C4::Context->config("enable_plugins") ) >+ if ( C4::Context->config("enable_plugins") and >+ ! C4::Context->needs_install ) # Koha is installed > { > # plugin needs to define a namespace > @plugins = Koha::Plugins->new()->GetPlugins( >@@ -53,10 +54,11 @@ sub register { > method => 'api_namespace', > } > ); >- } > >- foreach my $plugin ( @plugins ) { >- $spec = inject_routes( $spec, $plugin, $validator ); >+ foreach my $plugin ( @plugins ) { >+ $spec = inject_routes( $spec, $plugin, $validator ); >+ } >+ > } > > return $spec; >-- >2.26.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25131
:
102941
|
102942
|
102943
|
102989
|
102990
|
102991
|
102995
|
102996
|
102997
|
103015
|
104003