Explicitly clear these arrays and update them directly.
In practice item numbers were already in them when called
so that more items were being returned than were actually
renewed (or failed)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Functionally sound patch, and tested in production
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
my $patron = $self->{patron}; # SIP's patron
my $borrower = GetMember('cardnumber'=>$patron->id); # Koha's patron
my $all_ok = 1;
my $patron = $self->{patron}; # SIP's patron
my $borrower = GetMember('cardnumber'=>$patron->id); # Koha's patron
my $all_ok = 1;
+ $self->{renewed} = [];
+ $self->{unrenewed} = [];
foreach my $itemx (@{$patron->{items}}) {
my $item_id = $itemx->{barcode};
my $item = new ILS::Item $item_id;
foreach my $itemx (@{$patron->{items}}) {
my $item_id = $itemx->{barcode};
my $item = new ILS::Item $item_id;
$self->do_renew_for($borrower);
if ($self->ok) {
$item->{due_date} = $self->{due};
$self->do_renew_for($borrower);
if ($self->ok) {
$item->{due_date} = $self->{due};
- push @{$self->renewed }, $item_id;
+ push @{$self->{renewed} }, $item_id;
- push @{$self->unrenewed}, $item_id;
+ push @{$self->{unrenewed}}, $item_id;