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

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

Return to bug 22321