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

(-)a/Koha/Illrequest.pm (-1 / +21 lines)
Lines 1758-1765 possibly records the fact that something happened Link Here
1758
sub store {
1758
sub store {
1759
    my ( $self, $attrs ) = @_;
1759
    my ( $self, $attrs ) = @_;
1760
1760
1761
    my %updated_columns = $self->_result->get_dirty_columns;
1762
1763
    my @holds;
1764
    if( defined $updated_columns{'borrowernumber'} and
1765
        Koha::Patrons->find( $updated_columns{'borrowernumber'} ) )
1766
    {
1767
        # borrowernumber has changed
1768
        my $old_illreq = $self->get_from_storage;
1769
        @holds = Koha::Holds->search( {
1770
            borrowernumber => $old_illreq->borrowernumber,
1771
            biblionumber   => $self->biblio_id,
1772
        } )->as_list;
1773
    }
1774
1761
    my $ret = $self->SUPER::store;
1775
    my $ret = $self->SUPER::store;
1762
1776
1777
    if ( scalar @holds ) {
1778
        # move holds to the changed borrowernumber
1779
        foreach my $hold ( @holds ) {
1780
            $hold->borrowernumber( $updated_columns{'borrowernumber'} )->store;
1781
        }
1782
    }
1783
1763
    $attrs->{log_origin} = 'core';
1784
    $attrs->{log_origin} = 'core';
1764
1785
1765
    if ($ret && defined $attrs) {
1786
    if ($ret && defined $attrs) {
1766
- 

Return to bug 22321