Bugzilla – Attachment 116460 Details for
Bug 27466
Update process failing for 20.06.00.023
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27466: Don't use set_preference from updatedatabase.pl
Bug-27466-Dont-use-setpreference-from-updatedataba.patch (text/plain), 2.33 KB, created by
Katrin Fischer
on 2021-02-07 11:26:15 UTC
(
hide
)
Description:
Bug 27466: Don't use set_preference from updatedatabase.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-02-07 11:26:15 UTC
Size:
2.33 KB
patch
obsolete
>From 037d2ba00e41cbf4d91fc3f7d269d1c408515e56 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Jan 2021 11:16:48 +0100 >Subject: [PATCH] Bug 27466: Don't use set_preference from updatedatabase.pl > >We must never use subroutines or methods from updatedatabase.pl! > >Having it using C4::Context->set_preference will call >Koha::Config::Syspref->store then C4::Log::logaction and finally >Koha::Logger->get which will need the log4perl configured correctly >(which is not necessary the case when you upgrade). > >Test plan: >git checkout ed3e4540d73c1c3009375ad339e09a2e676fa1bd (20.06.00.022) >reset_all >Set the value of QuoteOfTheDay to 0 >git checkout bug_27466 (master + this patch) >updatedatabase >=> QuoteOfTheDay is an empty string >git checkout ed3e4540d73c1c3009375ad339e09a2e676fa1bd (20.06.00.022) >reset_all >Set the value of QuoteOfTheDay to 1 >git checkout bug_27466 (master + this patch) >updatedatabase >=> QuoteOfTheDay is set to "opac" > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > installer/data/mysql/updatedatabase.pl | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f18f375a23..6b5db2fcf5 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -22596,16 +22596,18 @@ if( CheckVersion( $DBversion ) ) { > $DBversion = '20.06.00.023'; > if( CheckVersion( $DBversion ) ) { > >- my $QuoteOfTheDay = C4::Context->preference('QuoteOfTheDay'); >+ my ( $QuoteOfTheDay ) = $dbh->selectrow_array(q| >+ SELECT value FROM systempreferences WHERE variable='QuoteOfTheDay' >+ |); >+ my $options = $QuoteOfTheDay ? 'opac' : ''; > $dbh->do( q| > UPDATE systempreferences >- SET options = 'intranet,opac', >+ SET value = ?, >+ options = 'intranet,opac', > explanation = 'Enable or disable display of Quote of the Day on the OPAC and staff interface home page', > type = 'multiple' > WHERE variable = 'QuoteOfTheDay' >- | ); >- >- C4::Context->set_preference('QuoteOfTheDay', $QuoteOfTheDay ? 'opac' : ''); >+ |, undef, $options ); > > NewVersion( $DBversion, 16371, "Quote of the Day (QOTD) for the staff interface " ); > } >-- >2.11.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 27466
:
115295
|
115417
|
115418
|
116439
| 116460