Bugzilla – Attachment 130545 Details for
Bug 22321
Make it possible to edit illrequests.borrowernumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22321: Update holds borrowernumber when ILL request borrowernumber changes
Bug-22321-Update-holds-borrowernumber-when-ILL-req.patch (text/plain), 1.44 KB, created by
Lari Taskula
on 2022-02-14 11:30:41 UTC
(
hide
)
Description:
Bug 22321: Update holds borrowernumber when ILL request borrowernumber changes
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2022-02-14 11:30:41 UTC
Size:
1.44 KB
patch
obsolete
>From 4c8605291b1c756069cad7fcb9c8d0708c4a9867 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Mon, 14 Feb 2022 11:16:31 +0000 >Subject: [PATCH] Bug 22321: Update holds borrowernumber when ILL request > borrowernumber changes > >To test: >1. prove t/db_dependent/Illrequests.t >--- > Koha/Illrequest.pm | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 6d26418cd9..c794f73e79 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -1634,8 +1634,29 @@ possibly records the fact that something happened > sub store { > my ( $self, $attrs ) = @_; > >+ my %updated_columns = $self->_result->get_dirty_columns; >+ >+ my @holds; >+ if( defined $updated_columns{'borrowernumber'} and >+ Koha::Patrons->find( $updated_columns{'borrowernumber'} ) ) >+ { >+ # borrowernumber has changed >+ my $old_illreq = $self->get_from_storage; >+ @holds = Koha::Holds->search( { >+ borrowernumber => $old_illreq->borrowernumber, >+ biblionumber => $self->biblio_id, >+ } )->as_list; >+ } >+ > my $ret = $self->SUPER::store; > >+ if ( scalar @holds ) { >+ # move holds to the changed borrowernumber >+ foreach my $hold ( @holds ) { >+ $hold->borrowernumber( $updated_columns{'borrowernumber'} )->store; >+ } >+ } >+ > $attrs->{log_origin} = 'core'; > > if ($ret && defined $attrs) { >-- >2.25.1
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 22321
:
130544
|
130545
|
130546
|
131012
|
131013
|
131055
|
131056
|
131057
|
131058
|
131059
|
138873
|
138874
|
138875
|
138876
|
138877
|
138878
|
141342
|
141343
|
141344
|
141345
|
141346
|
141347