From a8a16233336895e1e4514aa7f6e82b70a8183743 Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Tue, 22 May 2012 16:02:31 +0530 Subject: [PATCH] Bug 5795 Update the database as follow-up If sys pref ReservesControlBranch has null then update the table to insert a PatronLibrary as value To Test: 1) Go to mysql use koha database 2) select * from systempreferences where variable = 'ReservesControlBranch'; Check if value set to ItemHomeLibrary. +-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+ | variable | value | options | explanation | type | +-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+ | ReservesControlBranch | PatronLibrary | ItemHomeLibrary|PatronLibrary | Branch checked for members reservations rights. | Choice | +-----------------------+-----------------+-------------------------------+-------------------------------------------------+--------+ Signed-off-by: Chris Cormack Signed-off-by: Paul Poulain Conflicts: installer/data/mysql/updatedatabase.pl Signed-off-by: Chris Cormack Fixed for 3.8.x --- installer/data/mysql/updatedatabase.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 36ead90e5d..4483cbdbf9 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5225,6 +5225,14 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.08.01.001"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + unless(C4::Context->preference('ReservesControlBranch')){ + $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights.','Choice')"); +} + print "Upgrade to $DBversion done (Insert ReservesControlBranch systempreference into systempreferences table )\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS -- 2.39.2