Bugzilla – Attachment 102544 Details for
Bug 25081
new item for a received issue is (stochastically) not created
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25081: Fix creation of new item for a received issue
Bug-25081-Fix-creation-of-new-item-for-a-received-.patch (text/plain), 3.38 KB, created by
Jonathan Druart
on 2020-04-08 09:47:44 UTC
(
hide
)
Description:
Bug 25081: Fix creation of new item for a received issue
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-08 09:47:44 UTC
Size:
3.38 KB
patch
obsolete
>From e8ef5731031c2f042f7d9afacd053d6af945ab19 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Tue, 7 Apr 2020 22:23:20 +0200 >Subject: [PATCH] Bug 25081: Fix creation of new item for a received issue > >The Bug 23435 introduced the idea of multiple copies added while >receiving a new issue. Unfortunately, under some circumstances, it >causes no items being added at all. It occurs stochastically, only >under some conditions. But it is quite likely to happen while receiving >a supplemental issue. > >The reason fot hist is that, in serials-edit.pl, line ca 292 and infra, >@num_copies is treated in the same way as @tags, while it should be >treated similarly to @bibnums. It will be obvious after examining the >content of parameters tag, subfield, field_value, ..., number_of_copies. >In other words, for every edited issue number_of_copies is a scalar. > >Nota bene: >a) beter to initialize $countdistinct with zero; >b) note that in master, now, before applying the patch, >$itemhash{$item}->{'num_copies'} is treated once as a scalar >and in the next line--as an array: > >$itemhash{$item}->{'num_copies'} //= 1; > >for (my $copy = 0; $copy < $itemhash{$item}->{'num_copies'}[$index];){ > >TEST PLAN >========= >1. Have a subscription with the option "Create an item >record when receiving this serial" active and try to receive a >supplemental issue. Control that a new item under the biblio record >(usually) will not be created. >2. Apply the patch. >3. Repeat p. 1 -- a new item should be created. > >Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > serials/serials-edit.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl >index fd1b7bd31c..88445a92bc 100755 >--- a/serials/serials-edit.pl >+++ b/serials/serials-edit.pl >@@ -294,7 +294,7 @@ if ( $op and $op eq 'serialchangestatus' ) { > #Rebuilding ALL the data for items into a hash > # parting them on $itemid. > my %itemhash; >- my $countdistinct; >+ my $countdistinct = 0; > my $range = scalar(@itemid); > for ( my $i = 0 ; $i < $range ; $i++ ) { > unless ( $itemhash{ $itemid[$i] } ) { >@@ -308,6 +308,7 @@ if ( $op and $op eq 'serialchangestatus' ) { > $itemhash{ $itemid[$i] }->{'serial'} = $newserial; > } > $itemhash{ $itemid[$i] }->{'bibnum'} = $bibnums[$countdistinct]; >+ $itemhash{ $itemid[$i] }->{'num_copies'} = $num_copies[$countdistinct]; > $countdistinct++; > } > push @{ $itemhash{ $itemid[$i] }->{'tags'} }, $tags[$i]; >@@ -316,7 +317,6 @@ if ( $op and $op eq 'serialchangestatus' ) { > $field_values[$i]; > push @{ $itemhash{ $itemid[$i] }->{'ind_tag'} }, $ind_tag[$i]; > push @{ $itemhash{ $itemid[$i] }->{'indicator'} }, $indicator[$i]; >- push @{ $itemhash{ $itemid[$i] }->{'num_copies'} }, $num_copies[$i]; > } > foreach my $item ( keys %itemhash ) { > >@@ -346,7 +346,7 @@ if ( $op and $op eq 'serialchangestatus' ) { > > $itemhash{$item}->{'num_copies'} //= 1; > >- for (my $copy = 0; $copy < $itemhash{$item}->{'num_copies'}[$index];){ >+ for (my $copy = 0; $copy < $itemhash{$item}->{'num_copies'};){ > > # New Item > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25081
:
102527
|
102528
| 102544 |
102545