Bugzilla – Attachment 190575 Details for
Bug 41438
Batch hold tool: Suspended holds are unsuspended when making other changes to holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41438: Do not always unsuspend holds when using batch modify holds tool
e1b384d.patch (text/plain), 2.67 KB, created by
Martin Renvoize (ashimema)
on 2025-12-17 13:40:34 UTC
(
hide
)
Description:
Bug 41438: Do not always unsuspend holds when using batch modify holds tool
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-12-17 13:40:34 UTC
Size:
2.67 KB
patch
obsolete
>From e1b384d5024b5930e31822b248802168e9fed4fe Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Fri, 12 Dec 2025 12:58:22 +0200 >Subject: [PATCH] Bug 41438: Do not always unsuspend holds when using batch > modify holds tool > >If one modifies suspended holds e.g. changes their pickup library, holds >are unsuspended. This happens due error in logic of checking if "Suspend >holds" selection is empty. This patch fixes this by moving the if statement >for checking new suspended status before doing anything else for the value. > >To reproduce: >1. Navigate to Tools->Batch modify holds. >2. Search suspended holds. >3. Select a hold to modify and change it's pickup library, but leave >"Suspend holds" selection empty. >4. Press "Modify holds". >=> Note that hold is now unsuspended. >5. Apply this patch, start services again if needed. >6. Repeat steps from 2. to 4. >=> Note that hold is not suspended. >=> Confirm that suspending and unsuspending with and without suspend date >still works as expected. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > tools/batch_modify_holds.pl | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > >diff --git a/tools/batch_modify_holds.pl b/tools/batch_modify_holds.pl >index 0ae2836e7b6..4ba25f9cf40 100755 >--- a/tools/batch_modify_holds.pl >+++ b/tools/batch_modify_holds.pl >@@ -74,19 +74,21 @@ if ( $op eq 'cud-form' ) { > $hold->branchcode($new_pickup_loc)->store; > } > >- if ( $new_suspend_status && $new_suspend_status ne "" && !$hold->is_found ) { >- $hold->suspend(1)->store; >- if ($new_suspend_date) { >+ if ( $new_suspend_status ne "" ) { >+ if ( $new_suspend_status && !$hold->is_found ) { >+ $hold->suspend(1)->store; >+ if ($new_suspend_date) { >+ $hold->suspend_until($new_suspend_date)->store; >+ } else { >+ $hold->suspend_until(undef)->store; >+ } >+ } elsif ( !$new_suspend_status && $new_suspend_date ) { >+ $hold->suspend(1)->store; > $hold->suspend_until($new_suspend_date)->store; > } else { >+ $hold->suspend(0)->store; > $hold->suspend_until(undef)->store; > } >- } elsif ( !$new_suspend_status && $new_suspend_date ) { >- $hold->suspend(1)->store; >- $hold->suspend_until($new_suspend_date)->store; >- } else { >- $hold->suspend(0)->store; >- $hold->suspend_until(undef)->store; > } > > if ($new_hold_note) { >-- >2.52.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 41438
:
190454
|
190468
| 190575 |
190576
|
190611