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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 1522-1528 sub AddIssue { Link Here
1522
1522
1523
            # Get ID of logged in user.  if called from a batch job,
1523
            # Get ID of logged in user.  if called from a batch job,
1524
            # no user session exists and C4::Context->userenv() returns
1524
            # no user session exists and C4::Context->userenv() returns
1525
            # the scalar '0'. Only do this is the syspref says so
1525
            # the scalar '0'. Only do this if the syspref says so
1526
            if ( C4::Context->preference('RecordStaffUserOnCheckout') ) {
1526
            if ( C4::Context->preference('RecordStaffUserOnCheckout') ) {
1527
                my $userenv = C4::Context->userenv();
1527
                my $userenv = C4::Context->userenv();
1528
                my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : undef;
1528
                my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : undef;
(-)a/Koha/Patrons.pm (-3 / +1 lines)
Lines 195-203 sub anonymise_issue_history { Link Here
195
        }
195
        }
196
        );
196
        );
197
        my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef;
197
        my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef;
198
        $nb_rows += $old_issues_to_anonymise->update( {
198
        $nb_rows += $old_issues_to_anonymise->update( { 'old_issues.borrowernumber' => $anonymous_patron } );
199
            'old_issues.borrowernumber' => $anonymous_patron
200
        } );
201
    }
199
    }
202
    return $nb_rows;
200
    return $nb_rows;
203
}
201
}
(-)a/t/db_dependent/Koha/Checkouts.t (-4 / +3 lines)
Lines 94-102 subtest 'item' => sub { Link Here
94
    is( $item->itemnumber, $item_1->itemnumber, 'Koha::Checkout->item should return the correct item' );
94
    is( $item->itemnumber, $item_1->itemnumber, 'Koha::Checkout->item should return the correct item' );
95
};
95
};
96
96
97
$retrieved_checkout_1->delete;
98
is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
99
100
subtest 'patron' => sub {
97
subtest 'patron' => sub {
101
    plan tests => 3;
98
    plan tests => 3;
102
    my $patron = $builder->build_object({class=>'Koha::Patrons', value => {branchcode => $library->{branchcode}}});
99
    my $patron = $builder->build_object({class=>'Koha::Patrons', value => {branchcode => $library->{branchcode}}});
Lines 125-130 subtest 'patron' => sub { Link Here
125
    );
122
    );
126
};
123
};
127
124
125
$retrieved_checkout_1->delete;
126
is( Koha::Checkouts->search->count, $nb_of_checkouts + 1, 'Delete should have deleted the checkout' );
127
128
subtest 'issuer' => sub {
128
subtest 'issuer' => sub {
129
    plan tests => 3;
129
    plan tests => 3;
130
    my $patron = $builder->build_object({class=>'Koha::Patrons', value => {branchcode => $library->{branchcode}}});
130
    my $patron = $builder->build_object({class=>'Koha::Patrons', value => {branchcode => $library->{branchcode}}});
131
- 

Return to bug 23916