Bug 20825

Summary: Cannot checkout if item types at biblio level
Product: Koha Reporter: sergeinik <sergeinik>
Component: CirculationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: blocker    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jonathan.druart, katrin.fischer, kyle.m.hall, martin.renvoize, mtj, nick, tomascohen
Version: master   
Hardware: HP   
OS: Linux   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 19943    
Bug Blocks:    
Attachments: Message in browser
barcode input
18.05.00.000
item
item
Bug 20825: Add regression tests
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem
Bug 20825: Add regression tests
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem
Bug 20825: Add regression tests
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem
Bug 20825: Add regression tests
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem
Bug 20825: (QA follow-up) set biblioitemnumber with correct value

Description sergeinik 2018-05-27 16:32:13 UTC
Created attachment 75575 [details]
Message in browser

When I try to issue an instance and enter a barcode, the program displays the following message: Software error: The method is not covered by tests!
Comment 1 sergeinik 2018-05-27 16:35:37 UTC
Created attachment 75576 [details]
barcode input
Comment 2 Katrin Fischer 2018-05-28 05:57:44 UTC
Can you please check your item has a valid itemtype, homebranch and what is set in the not for loan status?

What is the exact version of Koha you are using?
Comment 3 sergeinik 2018-05-28 06:04:17 UTC
18.05.00.000
Comment 4 sergeinik 2018-05-28 06:04:59 UTC
Created attachment 75578 [details]
18.05.00.000
Comment 5 sergeinik 2018-05-28 06:08:06 UTC
This happened when the program was updated to the latest version.
Comment 6 Katrin Fischer 2018-05-28 06:08:46 UTC
Can you also share a screenshot of your item please?
Comment 7 sergeinik 2018-05-28 06:13:57 UTC
Created attachment 75579 [details]
item
Comment 8 sergeinik 2018-05-28 06:14:11 UTC
Created attachment 75580 [details]
item
Comment 9 sergeinik 2018-05-28 06:17:24 UTC
In version 17.11, the release works, but the return does not work, and in version 18.05 the output does not work, but the return works.
Comment 10 sergeinik 2018-05-28 06:19:35 UTC
And literally three days ago everything worked. But when the latest updates came one by one, everything broke.
Comment 11 Jonathan Druart 2018-05-28 13:56:14 UTC
Caused by
  commit 6183c0e6a910663fec02bdba66d05f173310f562
  Bug 19943: Koha::Biblio - Replace GetBiblioItemData with Koha::Biblio->biblioitem

It happens when item types are defined at biblio level.
Comment 12 Jonathan Druart 2018-05-28 14:29:42 UTC
Created attachment 75591 [details] [review]
Bug 20825: Add regression tests
Comment 13 Jonathan Druart 2018-05-28 14:29:47 UTC
Created attachment 75592 [details] [review]
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem

On bug 19943:
 -        elsif ($biblioitem->{'notforloan'} == 1){
 +        elsif ($biblioitem->notforloan == 1){

The biblioitems table does not contain a notforloan column, this comes
from the item type.

This bug only appears when item type is defined at biblio level
(item-level_itypes=0)

Test plan:
Set item-level_itypes = biblio
Check an item out

Without this patch it explodes with
"The method notforloan is not covered by tests!"
Comment 14 Tomás Cohen Arazi 2018-05-28 15:17:10 UTC
Created attachment 75595 [details] [review]
Bug 20825: Add regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 15 Tomás Cohen Arazi 2018-05-28 15:17:15 UTC
Created attachment 75596 [details] [review]
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem

On bug 19943:
 -        elsif ($biblioitem->{'notforloan'} == 1){
 +        elsif ($biblioitem->notforloan == 1){

The biblioitems table does not contain a notforloan column, this comes
from the item type.

This bug only appears when item type is defined at biblio level
(item-level_itypes=0)

Test plan:
Set item-level_itypes = biblio
Check an item out

Without this patch it explodes with
"The method notforloan is not covered by tests!"

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I reproduced the error condition and verified the tests failed without
this patch. After this patch is applied, tests pass and checkout
succeeds.
Comment 16 Katrin Fischer 2018-05-28 20:06:16 UTC
Created attachment 75605 [details] [review]
Bug 20825: Add regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2018-05-28 20:06:22 UTC
Created attachment 75606 [details] [review]
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem

On bug 19943:
 -        elsif ($biblioitem->{'notforloan'} == 1){
 +        elsif ($biblioitem->notforloan == 1){

The biblioitems table does not contain a notforloan column, this comes
from the item type.

This bug only appears when item type is defined at biblio level
(item-level_itypes=0)

Test plan:
Set item-level_itypes = biblio
Check an item out

Without this patch it explodes with
"The method notforloan is not covered by tests!"

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I reproduced the error condition and verified the tests failed without
this patch. After this patch is applied, tests pass and checkout
succeeds.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2018-05-28 20:08:38 UTC
Created attachment 75607 [details] [review]
Bug 20825: Add regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 19 Katrin Fischer 2018-05-28 20:08:43 UTC
Created attachment 75608 [details] [review]
Bug 20825: (bug 19943 follow-up) call notforloan on itemtype instead of biblioitem

On bug 19943:
 -        elsif ($biblioitem->{'notforloan'} == 1){
 +        elsif ($biblioitem->notforloan == 1){

The biblioitems table does not contain a notforloan column, this comes
from the item type.

This bug only appears when item type is defined at biblio level
(item-level_itypes=0)

Test plan:
Set item-level_itypes = biblio
Check an item out

Without this patch it explodes with
"The method notforloan is not covered by tests!"

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I reproduced the error condition and verified the tests failed without
this patch. After this patch is applied, tests pass and checkout
succeeds.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 sergeinik 2018-05-29 05:29:40 UTC
Thanks, it works.
Comment 21 Nick Clemens 2018-05-29 14:36:41 UTC
Pushed to master for 18.11.

Awesome work all, thank you.
Comment 22 Nick Clemens 2018-05-29 15:55:59 UTC
Created attachment 75639 [details] [review]
Bug 20825: (QA follow-up) set biblioitemnumber with correct value

Both biblionumber and biblioitemnumber for item were set to
biblionumber, when they don't line up tests fail

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 23 Martin Renvoize 2018-06-05 09:36:40 UTC
This patch has been pushed to 18.05.x, will be in 18.05.01
Comment 24 Fridolin Somers 2018-06-06 09:58:43 UTC
Depends on Bug 19943 not in 17.11.x