Summary: | new item for a received issue is (stochastically) not created | ||
---|---|---|---|
Product: | Koha | Reporter: | Janusz Kaczmarek <januszop> |
Component: | Serials | Assignee: | Janusz Kaczmarek <januszop> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | 1joynelson, aleisha, colin.campbell, jonathan.druart, lucas |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.05.00, 19.11.06
|
|
Circulation function: | |||
Bug Depends on: | 23435 | ||
Bug Blocks: | |||
Attachments: |
Bug 25081 - new item for a received issue is (stochastically) not created
Bug 25081 - new item for a received issue is (stochastically) not created Bug 25081: Fix creation of new item for a received issue Bug 25081: Fix wrong comment |
Description
Janusz Kaczmarek
2020-04-07 20:22:55 UTC
Created attachment 102527 [details] [review] Bug 25081 - new item for a received issue is (stochastically) not created 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. Created attachment 102528 [details] [review] Bug 25081 - new item for a received issue is (stochastically) not created 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> Created attachment 102544 [details] [review] 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> Created attachment 102545 [details] [review] Bug 25081: Fix wrong comment Not directly related to previous patch, coming from 23435. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Nice work everyone! Pushed to master for 20.05 (In reply to Martin Renvoize from comment #5) > Nice work everyone! > > Pushed to master for 20.05 I would suggest pushing it to 19.11.XX as well since 19.11 is affected. backported to 19.11.x for 19.11.06 missing dependencies for 19.05.x, no backport |