Bug 22321: Fix store() crash when modifying borrowernumber of a new ILL request
To test: 1. prove t/db_dependent/Illrequests.t Signed-off-by: Magnus Enger <magnus@libriotech.no> Tried to change the borrowernumber connected to an ILL request and checked that the associated hold was updated to the new patron as well. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
c99c42d5d4
commit
8ac3a5beec
|
|
@ -1761,7 +1761,7 @@ sub store {
|
|||
my %updated_columns = $self->_result->get_dirty_columns;
|
||||
|
||||
my @holds;
|
||||
if( defined $updated_columns{'borrowernumber'} and
|
||||
if( $self->in_storage and defined $updated_columns{'borrowernumber'} and
|
||||
Koha::Patrons->find( $updated_columns{'borrowernumber'} ) )
|
||||
{
|
||||
# borrowernumber has changed
|
||||
|
|
@ -1769,7 +1769,7 @@ sub store {
|
|||
@holds = Koha::Holds->search( {
|
||||
borrowernumber => $old_illreq->borrowernumber,
|
||||
biblionumber => $self->biblio_id,
|
||||
} )->as_list;
|
||||
} )->as_list if $old_illreq;
|
||||
}
|
||||
|
||||
my $ret = $self->SUPER::store;
|
||||
|
|
|
|||
Loading…
Reference in New Issue