From 8544dd37cbea7a55546d46ad2cdd8b478fa6e102 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 22 Dec 2025 13:58:18 +0000 Subject: [PATCH] Bug 40435: (follow-up) Change preference type to YesNo Change FutureHoldsBlockRenewals from type 'Integer' to 'YesNo' for consistency with other boolean preferences in Koha (e.g., AllowHoldDateInFuture, OPACAllowHoldDateInFuture). While the preference functionally works as Integer due to the .pref file defining the choices, YesNo is the established convention for binary system preferences. Test plan: 1. Apply this patch 2. Run the database update 3. Verify the preference appears correctly in system preferences 4. Verify the preference still functions properly with tests: prove t/db_dependent/Circulation.t :: "CanBookBeRenewed | future holds" Signed-off-by: Martin Renvoize --- installer/data/mysql/atomicupdate/bug_40435.pl | 2 +- installer/data/mysql/mandatory/sysprefs.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_40435.pl b/installer/data/mysql/atomicupdate/bug_40435.pl index 968736acc58..59b0f410364 100755 --- a/installer/data/mysql/atomicupdate/bug_40435.pl +++ b/installer/data/mysql/atomicupdate/bug_40435.pl @@ -10,7 +10,7 @@ return { $dbh->do( q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) - VALUES ('FutureHoldsBlockRenewals', 0, NULL, 'Allow future holds to block renewals', 'Integer' )} + VALUES ('FutureHoldsBlockRenewals', 0, NULL, 'Allow future holds to block renewals', 'YesNo' )} ); say $out "Added new system preference 'FutureHoldsBlockRenewals'"; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 69a69b7cc8e..bb8ec7435c8 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -297,7 +297,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ForceLibrarySelection','0',NULL,'Force staff to select a library when logging into the staff interface.','YesNo'), ('ForcePasswordResetWhenSetByStaff','0',NULL,'Force a staff created patron account to reset its password after its first OPAC login.','YesNo'), ('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'), -('FutureHoldsBlockRenewals', 0, NULL, 'Allow future holds to block renewals', 'Integer' ), +('FutureHoldsBlockRenewals', 0, NULL, 'Allow future holds to block renewals', 'YesNo' ), ('GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field of MARC21 records', 'free'), ('GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field of MARC21 records', 'free'), ('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'), -- 2.52.0