From 5345fbf908011814e4f3b569def5a0ffca7b0813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= Date: Sat, 2 May 2026 11:33:29 -0300 Subject: [PATCH] Bug 42489: Add RealTimeHoldsQueueUnallocated syspref Adds a new system preference to control whether the real-time holds queue processes only unallocated holds (faster, additive) or rebuilds the entire queue for the affected biblio (current behavior, more thorough). Default is off (preserving current behavior). Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ perl installer/data/mysql/updatedatabase.pl => SUCCESS: New preference added 3. Verify RealTimeHoldsQueueUnallocated appears in Administration > System preferences > Circulation 4. Sign off :-D Signed-off-by: Alex Carver [Acerock7] Signed-off-by: Pedro Amorim --- .../data/mysql/atomicupdate/bug_42489.pl | 20 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 7 +++++++ 3 files changed, 28 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_42489.pl diff --git a/installer/data/mysql/atomicupdate/bug_42489.pl b/installer/data/mysql/atomicupdate/bug_42489.pl new file mode 100755 index 0000000000..b68a270142 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_42489.pl @@ -0,0 +1,20 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_success); + +return { + bug_number => "42489", + description => "Add RealTimeHoldsQueueUnallocated system preference", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences (variable, value) + VALUES ('RealTimeHoldsQueueUnallocated', '0') + } + ); + + say_success( $out, "Added new system preference 'RealTimeHoldsQueueUnallocated'" ); + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index dc6fe6553e..13b13d8a9e 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -692,6 +692,7 @@ INSERT INTO systempreferences ( `variable`, `value` ) VALUES ('QuoteOfTheDay',''), ('RandomizeHoldsQueueWeight','0'), ('RealTimeHoldsQueue', '0'), +('RealTimeHoldsQueueUnallocated', '0'), ('RecallsLog','1'), ('RecallsMaxPickUpDelay','7'), ('RecordLocalUseOnReturn','0'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 5ef1d9316b..71721ab086 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -838,6 +838,13 @@ Circulation: 1: Enable 0: Disable - updating the holds queue in real time. + - + - "When RealTimeHoldsQueue is enabled:" + - pref: RealTimeHoldsQueueUnallocated + choices: + 1: only process unallocated holds + 0: rebuild the entire queue for the affected biblio + - ". Processing only unallocated holds is faster but will not recalculate existing allocations." - - pref: AllowHoldItemTypeSelection choices: