View | Details | Raw Unified | Return to bug 22321
Collapse All | Expand All

(-)a/Koha/Illrequest.pm (-1 / +21 lines)
Lines 1632-1639 possibly records the fact that something happened Link Here
1632
sub store {
1632
sub store {
1633
    my ( $self, $attrs ) = @_;
1633
    my ( $self, $attrs ) = @_;
1634
1634
1635
    my %updated_columns = $self->_result->get_dirty_columns;
1636
1637
    my @holds;
1638
    if( defined $updated_columns{'borrowernumber'} and
1639
        Koha::Patrons->find( $updated_columns{'borrowernumber'} ) )
1640
    {
1641
        # borrowernumber has changed
1642
        my $old_illreq = $self->get_from_storage;
1643
        @holds = Koha::Holds->search( {
1644
            borrowernumber => $old_illreq->borrowernumber,
1645
            biblionumber   => $self->biblio_id,
1646
        } )->as_list;
1647
    }
1648
1635
    my $ret = $self->SUPER::store;
1649
    my $ret = $self->SUPER::store;
1636
1650
1651
    if ( scalar @holds ) {
1652
        # move holds to the changed borrowernumber
1653
        foreach my $hold ( @holds ) {
1654
            $hold->borrowernumber( $updated_columns{'borrowernumber'} )->store;
1655
        }
1656
    }
1657
1637
    $attrs->{log_origin} = 'core';
1658
    $attrs->{log_origin} = 'core';
1638
1659
1639
    if ($ret && defined $attrs) {
1660
    if ($ret && defined $attrs) {
1640
- 

Return to bug 22321