Bug 26987

Summary: No property notforloan for Koha::Serial::Item
Product: Koha Reporter: Magnus Enger <magnus>
Component: SerialsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: blocker    
Priority: P5 - low CC: aleisha, colin.campbell, jonathan.druart, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.06
Bug Depends on: 23463    
Bug Blocks:    
Attachments: Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable

Description Magnus Enger 2020-11-10 13:09:32 UTC
After upgrading to 20.05.05, when I try to receive a serials issue I get this error:

"No property itype for Koha::Serial::Item at /usr/share/perl5/Exception/Class/Base.pm line 8

This is when I mark the issue as "Received", get the form to add the item and click "save".
Comment 1 Jonathan Druart 2020-11-10 13:10:18 UTC
Coming from
  commit bbb504c86f5ca0a474365d4839177412f415c4ee
  Bug 23463: Replace ModItem with Koha::Item->store
Comment 2 Jonathan Druart 2020-11-10 13:13:43 UTC Comment hidden (obsolete)
Comment 3 Magnus Enger 2020-11-10 14:00:46 UTC
Created attachment 113397 [details] [review]
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable

$serialitem is not a Koha::Item there, we need to fetch the item before.

Test plan:
Turn makePreviousSerialAvailable on
Create a subscription
Receive an serial item, mark it "arrived"
Without this patch Koha explodes with
No property notforloan for Koha::Serial::Item at /usr/share/perl5/Exception/Class/Base.pm line 88
Koha::Object::set('Koha::Serial::Item=HASH(0x55dd67c75700)', 'HASH(0x55dd672cec30)') called at /kohadevbox/koha/serials/serials-edit.pl line 273

With this patch applied the notforloan and itype values are correctly
set for the new serial item.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Applied the patch on a live server showing the described problem,
and the problem was fixed, Koha does not explode.
Comment 4 Katrin Fischer 2020-11-10 14:25:44 UTC
I think this warrants blocker status - can't receive items for serials while this is not fixed in 20.05.x
Comment 5 Martin Renvoize 2020-11-11 13:38:23 UTC
Created attachment 113496 [details] [review]
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable

$serialitem is not a Koha::Item there, we need to fetch the item before.

Test plan:
Turn makePreviousSerialAvailable on
Create a subscription
Receive an serial item, mark it "arrived"
Without this patch Koha explodes with
No property notforloan for Koha::Serial::Item at /usr/share/perl5/Exception/Class/Base.pm line 88
Koha::Object::set('Koha::Serial::Item=HASH(0x55dd67c75700)', 'HASH(0x55dd672cec30)') called at /kohadevbox/koha/serials/serials-edit.pl line 273

With this patch applied the notforloan and itype values are correctly
set for the new serial item.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-11-11 13:38:52 UTC
Good catch, works as expected after patch, no regressions found.

Passing QA
Comment 7 Jonathan Druart 2020-11-11 15:09:21 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 8 Lucas Gass 2020-11-16 22:42:48 UTC
backported to 20.05.x for 20.05.06
Comment 9 Aleisha Amohia 2020-11-17 05:43:04 UTC
missing dependencies, not backported to 19.11.x