Bugzilla – Attachment 89116 Details for
Bug 22053
Ability to disable some plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22053: (QA follow-up) Override enable_plugins configuration
Bug-22053-QA-follow-up-Override-enableplugins-conf.patch (text/plain), 2.73 KB, created by
Tomás Cohen Arazi
on 2019-04-30 13:56:08 UTC
(
hide
)
Description:
Bug 22053: (QA follow-up) Override enable_plugins configuration
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2019-04-30 13:56:08 UTC
Size:
2.73 KB
patch
obsolete
>From 070e65606855ef275b6ec6fe1b31909877c55d01 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 30 Apr 2019 10:54:01 -0300 >Subject: [PATCH] Bug 22053: (QA follow-up) Override enable_plugins > configuration > >This patch makes the update script override the configured >enable_plugins setting in koha-conf.xml. > >on testing the failure I wrote trivial tests on how >Koha::Plugins->new({ enable_plugins => 1 }) should work. Adding them to >this patch as well. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../bug_22053_enable-all-plugins.perl | 4 ++-- > t/db_dependent/Plugins.t | 16 +++++++++++++++- > 2 files changed, 17 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_22053_enable-all-plugins.perl b/installer/data/mysql/atomicupdate/bug_22053_enable-all-plugins.perl >index 63ef70a1d0..206ed6f5ce 100644 >--- a/installer/data/mysql/atomicupdate/bug_22053_enable-all-plugins.perl >+++ b/installer/data/mysql/atomicupdate/bug_22053_enable-all-plugins.perl >@@ -3,7 +3,7 @@ if( CheckVersion( $DBversion ) ) { > > use Koha::Plugins; > >- my @plugins = Koha::Plugins->new()->GetPlugins({ all => 1 }); >+ my @plugins = Koha::Plugins->new({ enable_plugins => 1 })->GetPlugins({ all => 1 }); > foreach my $plugin ( @plugins ) { > $plugin->enable; > } >@@ -11,4 +11,4 @@ if( CheckVersion( $DBversion ) ) { > # Always end with this (adjust the bug info) > SetVersion( $DBversion ); > print "Upgrade to $DBversion done (Bug 22053 - enable all plugins)\n"; >-} >\ No newline at end of file >+} >diff --git a/t/db_dependent/Plugins.t b/t/db_dependent/Plugins.t >index e89cebe0b3..8e45e078af 100755 >--- a/t/db_dependent/Plugins.t >+++ b/t/db_dependent/Plugins.t >@@ -9,7 +9,7 @@ use File::Temp qw( tempdir tempfile ); > use FindBin qw($Bin); > use Module::Load::Conditional qw(can_load); > use Test::MockModule; >-use Test::More tests => 46; >+use Test::More tests => 47; > > use C4::Context; > use Koha::Database; >@@ -209,3 +209,17 @@ subtest 'Test _version_compare' => sub { > is( Koha::Plugins::Base::_version_compare( '1', '1.0.0' ), 0, "1 is equal to 1.0.0" ); > is( Koha::Plugins::Base::_version_compare( '1.0', '1.0.0' ), 0, "1.0 is equal to 1.0.0" ); > }; >+ >+subtest 'new() tests' => sub { >+ >+ plan tests => 2; >+ >+ t::lib::Mocks::mock_config( 'pluginsdir', [ C4::Context->temporary_directory ] ); >+ t::lib::Mocks::mock_config( 'enable_plugins', 0 ); >+ >+ my $result = Koha::Plugins->new(); >+ is( $result, undef, 'calling new() on disabled plugins returns undef' ); >+ >+ $result = Koha::Plugins->new({ enable_plugins => 1 }); >+ is( ref($result), 'Koha::Plugins', 'calling new with enable_plugins makes it override the config' ); >+}; >-- >2.21.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 22053
:
83537
|
83538
|
83539
|
83540
|
83666
|
83667
|
86961
|
86962
|
86963
|
86964
|
88783
|
88784
|
88785
|
88818
|
88819
|
88820
|
89040
|
89041
|
89042
|
89043
| 89116 |
89551
|
89558