Bugzilla – Attachment 194987 Details for
Bug 41801
FixPriority recursive calls for lowestPriority holds can be removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41801: (QA follow-up) Guard lowestPriority rank clamping against empty rank
73a0997.patch (text/plain), 1.28 KB, created by
Martin Renvoize (ashimema)
on 2026-03-09 10:37:55 UTC
(
hide
)
Description:
Bug 41801: (QA follow-up) Guard lowestPriority rank clamping against empty rank
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-03-09 10:37:55 UTC
Size:
1.28 KB
patch
obsolete
>From 73a099736f192db83cb25751176c9b0830f7eb2b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Mon, 9 Mar 2026 09:29:26 +0000 >Subject: [PATCH] Bug 41801: (QA follow-up) Guard lowestPriority rank clamping > against empty rank > >When FixPriority is called with a reserve_id but no rank (rank defaults to ''), >the empty string evaluates to 0 numerically, satisfying `$rank <= >$highest_non_lowest_priority`. This caused the clamping block to unexpectedly >set rank to a positive value, which then triggered an unintended splice and >moved the hold. > >Add `$rank > 0` to the guard condition so the block only fires when an explicit >positive rank was requested, matching the pre-existing semantics of the splice >block below it. >--- > C4/Reserves.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index a65d98c4637..63760e3a9bf 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1727,7 +1727,7 @@ sub FixPriority { > } > > # if this hold is marked lowest priority, we can only move it so far >- if ( $hold && $hold->lowestPriority && $rank ne 'del' ) { >+ if ( $hold && $hold->lowestPriority && $rank ne 'del' && $rank > 0 ) { > my $query = " > SELECT max(priority) > FROM reserves >-- >2.53.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 41801
:
192820
|
194985
|
194986
| 194987 |
194988
|
194989
|
194990