Bug 26987 - No property notforloan for Koha::Serial::Item
Summary: No property notforloan for Koha::Serial::Item
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: master
Hardware: All All
: P5 - low blocker (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 23463
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-10 13:09 UTC by Magnus Enger
Modified: 2020-11-17 20:56 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.06


Attachments
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable (1.61 KB, patch)
2020-11-10 13:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable (1.78 KB, patch)
2020-11-10 14:00 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 26987: (bug 23463 follow-up) Fix serial receipt if makePreviousSerialAvailable (1.73 KB, patch)
2020-11-11 13:38 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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