Bug 23679

Summary: Software error when trying to transfer an unknown barcode
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: CirculationAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.05
Attachments: Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t
Bug 23679: fix software error when trying to transfer an unknown barcode
Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t
Bug 23679: fix software error when trying to transfer an unknown barcode
Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t
Bug 23679: fix software error when trying to transfer an unknown barcode
Bug 23679: fix software error when trying to transfer an unknown barcode
Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t
Bug 23679: fix software error when trying to transfer an unknown barcode
Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t

Description Fridolin Somers 2019-09-26 07:08:07 UTC
When trying to transfer an unknown barcode in /cgi-bin/koha/circ/branchtransfers.pl you get the error :

Can't call method "itemnumber" on an undefined value at /home/koha/src/C4/Circulation.pm line 319.

This comes from C4::Circulation::transferbook which should stop when finding unknown barcode.
Comment 1 Fridolin Somers 2019-09-26 07:14:52 UTC Comment hidden (obsolete)
Comment 2 Fridolin Somers 2019-09-26 07:15:09 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2019-09-27 12:04:57 UTC
Created attachment 93198 [details] [review]
Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t

I've choosen to add it to db_dependent because we may add other tests
to cover transferbook() cases that will change DB

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Owen Leonard 2019-09-27 12:05:00 UTC
Created attachment 93199 [details] [review]
Bug 23679: fix software error when trying to transfer an unknown barcode

When trying to transfer an unknown barcode in
/cgi-bin/koha/circ/branchtransfers.pl you get the error :

Can't call method "itemnumber" on an undefined value at
/home/koha/src/C4/Circulation.pm line 319.

This comes from C4::Circulation::transferbook which should stop when
finding unknown barcode.

Test plan :
1) Go to /cgi-bin/koha/circ/branchtransfers.pl
2) Enter a barcode not existing in database
3) Without patch you get a software error, with patch you get a message
   saying 'No Item with barcode'
4) Enter a barcode existing in database and check transfer is OK

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Bin Wen 2019-09-27 19:27:49 UTC
Created attachment 93211 [details] [review]
Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t

I've choosen to add it to db_dependent because we may add other tests
to cover transferbook() cases that will change DB

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Bin Wen 2019-09-27 19:35:51 UTC
Created attachment 93212 [details] [review]
Bug 23679: fix software error when trying to transfer an unknown barcode

When trying to transfer an unknown barcode in
/cgi-bin/koha/circ/branchtransfers.pl you get the error :

Can't call method "itemnumber" on an undefined value at
/home/koha/src/C4/Circulation.pm line 319.

This comes from C4::Circulation::transferbook which should stop when
finding unknown barcode.

Test plan :
1) Go to /cgi-bin/koha/circ/branchtransfers.pl
2) Enter a barcode not existing in database
3) Without patch you get a software error, with patch you get a message
   saying 'No Item with barcode'
4) Enter a barcode existing in database and check transfer is OK

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Bin Wen 2019-09-27 19:50:07 UTC
Created attachment 93213 [details] [review]
Bug 23679: fix software error when trying to transfer an unknown barcode

When trying to transfer an unknown barcode in
/cgi-bin/koha/circ/branchtransfers.pl you get the error :

Can't call method "itemnumber" on an undefined value at
/home/koha/src/C4/Circulation.pm line 319.

This comes from C4::Circulation::transferbook which should stop when
finding unknown barcode.

Test plan :
1) Go to /cgi-bin/koha/circ/branchtransfers.pl
2) Enter a barcode not existing in database
3) Without patch you get a software error, with patch you get a message
   saying 'No Item with barcode'
4) Enter a barcode existing in database and check transfer is OK

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Comment 8 Bin Wen 2019-09-27 19:50:13 UTC
Created attachment 93214 [details] [review]
Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t

I've choosen to add it to db_dependent because we may add other tests
to cover transferbook() cases that will change DB

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Comment 9 Nick Clemens 2019-09-30 11:51:15 UTC
Created attachment 93235 [details] [review]
Bug 23679: fix software error when trying to transfer an unknown barcode

When trying to transfer an unknown barcode in
/cgi-bin/koha/circ/branchtransfers.pl you get the error :

Can't call method "itemnumber" on an undefined value at
/home/koha/src/C4/Circulation.pm line 319.

This comes from C4::Circulation::transferbook which should stop when
finding unknown barcode.

Test plan :
1) Go to /cgi-bin/koha/circ/branchtransfers.pl
2) Enter a barcode not existing in database
3) Without patch you get a software error, with patch you get a message
   saying 'No Item with barcode'
4) Enter a barcode existing in database and check transfer is OK

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Nick Clemens 2019-09-30 11:51:23 UTC
Created attachment 93236 [details] [review]
Bug 23679: add Unit Test t/db_dependent/Circulation/transferbook.t

I've choosen to add it to db_dependent because we may add other tests
to cover transferbook() cases that will change DB

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Bin Wen <bin.wen@inlibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Martin Renvoize 2019-10-01 06:45:57 UTC
Nice work!

Pushed to master for 19.11.00
Comment 12 Fridolin Somers 2019-10-08 07:46:52 UTC
+my $badbc = 'wherethehelldoyoucomefrom';
Did you see this egg XD
Comment 13 Fridolin Somers 2019-10-08 07:47:17 UTC
Pushed to 19.05.x for 19.05.05
Comment 14 Lucas Gass 2019-11-13 22:38:16 UTC
backported to 18.11.x for 18.11.11