Bugzilla – Attachment 179292 Details for
Bug 31698
Add ability to move a hold to a new bibliographic record/item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31698: Improve priority
Bug-31698-Improve-priority.patch (text/plain), 1.86 KB, created by
Lucas Gass (lukeg)
on 2025-03-13 23:29:56 UTC
(
hide
)
Description:
Bug 31698: Improve priority
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-03-13 23:29:56 UTC
Size:
1.86 KB
patch
obsolete
>From 5aed2badda0aa2643dbec9fb0d1c43a8f3603fc9 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 13 Mar 2025 23:29:39 +0000 >Subject: [PATCH] Bug 31698: Improve priority > >--- > Koha/Hold.pm | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index f1db5b27a1a..54056435ac3 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -187,9 +187,10 @@ $hold->move_hold_item(); > sub move_hold_item { > my ( $self, $args ) = @_; > >- my $new_itemnumber = $args->{new_itemnumber}; >- my $new_biblionumber = $args->{new_biblionumber}; >- my $original = $self; >+ my $new_itemnumber = $args->{new_itemnumber}; >+ my $new_biblionumber = $args->{new_biblionumber}; >+ my $original = $self; >+ my $original_biblionumber = $self->biblionumber; > > my $patron = Koha::Patrons->find( { borrowernumber => $self->borrowernumber } ); > my $new_item = Koha::Items->find( { itemnumber => $new_itemnumber } ); >@@ -202,14 +203,14 @@ sub move_hold_item { > > if ( $canReserve->{status} eq 'OK' ) { > >- # Find the lowest priority among holds on this biblio >- my $lowest_priority = Koha::Holds->search( >+ # Find the highest priority among holds on the new item >+ my $highest_new_priority = Koha::Holds->search( > { biblionumber => $new_biblionumber }, > { order_by => { -desc => 'priority' }, rows => 1 } > )->next; > >- # Set priority to the lowest + 1, or 1 if there are no others >- my $new_priority = $lowest_priority ? $lowest_priority->priority + 1 : 1; >+ my $max_new_priority = $highest_new_priority ? $highest_new_priority->priority : 0; >+ my $new_priority = $max_new_priority + 1; > > $self->update( > { >-- >2.39.5
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 31698
:
179226
|
179235
|
179236
|
179279
|
179287
|
179290
|
179291
|
179292
|
179295
|
179704
|
179711
|
179713
|
181222
|
181223
|
181224
|
181225
|
181226
|
181228
|
181229
|
181230
|
181231
|
181232
|
181233
|
181234
|
181929
|
181930
|
181944
|
181945
|
181946
|
181947
|
181948
|
181951
|
181952
|
181953
|
181954
|
181955
|
181956
|
181957
|
181958
|
181959
|
181960
|
181961
|
181962
|
182639
|
182640
|
182641