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

(-)a/C4/Circulation.pm (-7 lines)
Lines 2172-2185 sub MarkIssueReturned { Link Here
2172
    push @bind, $issue_id;
2172
    push @bind, $issue_id;
2173
2173
2174
    # FIXME Improve the return value and handle it from callers
2174
    # FIXME Improve the return value and handle it from callers
2175
    my $do_not_lock = ( exists $ENV{_} && $ENV{_} =~ m|prove| ) || $ENV{KOHA_NO_TABLE_LOCKS};
2176
    $schema->txn_do(sub {
2175
    $schema->txn_do(sub {
2177
2176
2178
        $dbh->do( $query, undef, @bind );
2177
        $dbh->do( $query, undef, @bind );
2179
2178
2180
        C4::Context->dbh->do(q|LOCK TABLE old_issues READ|) unless $do_not_lock;
2181
        C4::Context->dbh->do(q|LOCK TABLE old_issues WRITE|) unless $do_not_lock;
2182
2183
        my $issue = Koha::Checkouts->find( $issue_id ); # FIXME should be fetched earlier
2179
        my $issue = Koha::Checkouts->find( $issue_id ); # FIXME should be fetched earlier
2184
2180
2185
        # Create the old_issues entry
2181
        # Create the old_issues entry
Lines 2196-2203 sub MarkIssueReturned { Link Here
2196
        $old_checkout_data->{issue_id} = $issue_id;
2192
        $old_checkout_data->{issue_id} = $issue_id;
2197
        my $old_checkout = Koha::Old::Checkout->new($old_checkout_data)->store;
2193
        my $old_checkout = Koha::Old::Checkout->new($old_checkout_data)->store;
2198
2194
2199
        C4::Context->dbh->do(q|UNLOCK TABLES|) unless $do_not_lock;
2200
2201
        # Update the fines
2195
        # Update the fines
2202
        $dbh->do(q|UPDATE accountlines SET issue_id = ? WHERE issue_id = ?|, undef, $old_checkout->issue_id, $issue->issue_id);
2196
        $dbh->do(q|UPDATE accountlines SET issue_id = ? WHERE issue_id = ?|, undef, $old_checkout->issue_id, $issue->issue_id);
2203
2197
2204
- 

Return to bug 18651