Bug 17214

Summary: Add records to lists by biblio number
Product: Koha Reporter: Vinod <mishravk79>
Component: ListsAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: aleisha, m.de.rooy, mtompset, sandboxes, sandboxes
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 17214: Add records to lists by biblionumber
Bug 17214: Add records to lists by biblionumber
Bug 17214: Add records to lists by biblionumber
Bug 17214: Add records to lists by biblionumber
Bug 17214: [FOLLOW-UP] Using Koha::Biblios instead of GetBiblio
Bug 17214: Add records to lists by biblionumber
Bug 17214: [FOLLOW-UP] Using Koha::Biblios instead of GetBiblio
Bug 17214: Add records to lists by biblionumber
Bug 17214: Add records to lists by biblionumber
Bug 17214: (QA follow-up) Print error message too in fallback case

Description Vinod 2016-08-29 11:47:44 UTC
Once the LIST is created in Koha you can add item in that by barcode but is there any option to add item by record number because if there is no barcode assigned to the item how it can be added to the list? For example in case of remotely available resources like e-book/e-journals where library may enter only bibliographic details.
Comment 1 Mark Tompsett 2016-08-29 12:45:39 UTC
While record number is a bad idea, biblionumber, would be okay.
Comment 2 Aleisha Amohia 2017-04-19 01:59:06 UTC
If you were to add to a list by biblionumber, if that record has multiple items under it, does it add all items with that biblionumber or just the first item?
Comment 3 Marcel de Rooy 2017-04-19 11:06:14 UTC
(In reply to Aleisha Amohia from comment #2)
> If you were to add to a list by biblionumber, if that record has multiple
> items under it, does it add all items with that biblionumber or just the
> first item?

A list contains of biblios, not items.
Comment 4 Aleisha Amohia 2017-04-20 01:54:10 UTC
Created attachment 62431 [details] [review]
Bug 17214: Add records to lists by biblionumber

To test:
1) Apply patch and go to Lists
2) Click on an existing list or create a new list
3) Add items by barcode, confirm this functionality still works
4) Trigger error messages (adding duplicate barcodes, barcodes that
don't exist) to confirm they still show as appropriate
5) Test adding by biblionumber, confirm this works as expected
6) Trigger error messages (adding duplicate biblionumbers, biblionumbers
that don't exist). Confirm wording is appropriate in messages.
7) Add both barcodes and biblionumbers at the same time, confirm this
works as expected

Sponsored-by: Catalyst IT
Comment 5 PTFS Europe Sandboxes 2017-06-23 03:13:49 UTC
Patch tested with a sandbox, by Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Comment 6 PTFS Europe Sandboxes 2017-06-23 03:14:15 UTC
Created attachment 64567 [details] [review]
Bug 17214: Add records to lists by biblionumber

To test:
1) Apply patch and go to Lists
2) Click on an existing list or create a new list
3) Add items by barcode, confirm this functionality still works
4) Trigger error messages (adding duplicate barcodes, barcodes that
don't exist) to confirm they still show as appropriate
5) Test adding by biblionumber, confirm this works as expected
6) Trigger error messages (adding duplicate biblionumbers, biblionumbers
that don't exist). Confirm wording is appropriate in messages.
7) Add both barcodes and biblionumbers at the same time, confirm this
works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Comment 7 PTFS Europe Sandboxes 2017-06-23 03:14:58 UTC
Patch tested with a sandbox, by Harold <harold.sabanal@gmail.com>
Comment 8 PTFS Europe Sandboxes 2017-06-23 03:15:28 UTC
Created attachment 64568 [details] [review]
Bug 17214: Add records to lists by biblionumber

To test:
1) Apply patch and go to Lists
2) Click on an existing list or create a new list
3) Add items by barcode, confirm this functionality still works
4) Trigger error messages (adding duplicate barcodes, barcodes that
don't exist) to confirm they still show as appropriate
5) Test adding by biblionumber, confirm this works as expected
6) Trigger error messages (adding duplicate biblionumbers, biblionumbers
that don't exist). Confirm wording is appropriate in messages.
7) Add both barcodes and biblionumbers at the same time, confirm this
works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>

Signed-off-by: Harold <harold.sabanal@gmail.com>
Comment 9 Biblibre Sandboxes 2017-06-23 03:46:11 UTC
Patch tested with a sandbox, by macon lauren KohaCon2017 <caballeromaricon@gmail.com>
Comment 10 Biblibre Sandboxes 2017-06-23 03:46:33 UTC
Created attachment 64569 [details] [review]
Bug 17214: Add records to lists by biblionumber

To test:
1) Apply patch and go to Lists
2) Click on an existing list or create a new list
3) Add items by barcode, confirm this functionality still works
4) Trigger error messages (adding duplicate barcodes, barcodes that
don't exist) to confirm they still show as appropriate
5) Test adding by biblionumber, confirm this works as expected
6) Trigger error messages (adding duplicate biblionumbers, biblionumbers
that don't exist). Confirm wording is appropriate in messages.
7) Add both barcodes and biblionumbers at the same time, confirm this
works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>

Signed-off-by: Harold <harold.sabanal@gmail.com>

Signed-off-by: macon lauren KohaCon2017 <caballeromaricon@gmail.com>
Comment 11 Marcel de Rooy 2017-09-01 10:16:48 UTC
QA: Looking here now.
Comment 12 Marcel de Rooy 2017-09-01 10:27:15 UTC
Bug 18260 has been pushed in the meantime and it removed GetBiblio.
Comment 13 Marcel de Rooy 2017-09-01 10:27:51 UTC
Internal server error:

Undefined subroutine &CGI::Compile::ROOT::usr_share_koha_masterclone_virtualshelves_shelves_2epl::GetBiblio called at /usr/share/koha/masterclone/virtualshelves/shelves.pl line 178.
Comment 14 Aleisha Amohia 2017-09-05 02:58:55 UTC
Created attachment 66828 [details] [review]
Bug 17214: [FOLLOW-UP] Using Koha::Biblios instead of GetBiblio

Ready to test
Comment 15 Katrin Fischer 2017-10-07 23:36:21 UTC
Created attachment 67815 [details] [review]
Bug 17214: Add records to lists by biblionumber

To test:
1) Apply patch and go to Lists
2) Click on an existing list or create a new list
3) Add items by barcode, confirm this functionality still works
4) Trigger error messages (adding duplicate barcodes, barcodes that
don't exist) to confirm they still show as appropriate
5) Test adding by biblionumber, confirm this works as expected
6) Trigger error messages (adding duplicate biblionumbers, biblionumbers
that don't exist). Confirm wording is appropriate in messages.
7) Add both barcodes and biblionumbers at the same time, confirm this
works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>

Signed-off-by: Harold <harold.sabanal@gmail.com>

Signed-off-by: macon lauren KohaCon2017 <caballeromaricon@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Katrin Fischer 2017-10-07 23:36:25 UTC
Created attachment 67816 [details] [review]
Bug 17214: [FOLLOW-UP] Using Koha::Biblios instead of GetBiblio

Ready to test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2017-10-07 23:36:41 UTC
Nice!
Comment 18 Marcel de Rooy 2017-10-27 07:02:57 UTC
QA: Looking here now
Comment 19 Marcel de Rooy 2017-10-27 07:35:04 UTC
Created attachment 68657 [details] [review]
Bug 17214: Add records to lists by biblionumber

To test:
1) Apply patch and go to Lists
2) Click on an existing list or create a new list
3) Add items by barcode, confirm this functionality still works
4) Trigger error messages (adding duplicate barcodes, barcodes that
don't exist) to confirm they still show as appropriate
5) Test adding by biblionumber, confirm this works as expected
6) Trigger error messages (adding duplicate biblionumbers, biblionumbers
that don't exist). Confirm wording is appropriate in messages.
7) Add both barcodes and biblionumbers at the same time, confirm this
works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>

Signed-off-by: Harold <harold.sabanal@gmail.com>

Signed-off-by: macon lauren KohaCon2017 <caballeromaricon@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 17214: [FOLLOW-UP] Using Koha::Biblios instead of GetBiblio

Ready to test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 20 Marcel de Rooy 2017-10-27 07:35:38 UTC
Created attachment 68658 [details] [review]
Bug 17214: Add records to lists by biblionumber

To test:
1) Apply patch and go to Lists
2) Click on an existing list or create a new list
3) Add items by barcode, confirm this functionality still works
4) Trigger error messages (adding duplicate barcodes, barcodes that
don't exist) to confirm they still show as appropriate
5) Test adding by biblionumber, confirm this works as expected
6) Trigger error messages (adding duplicate biblionumbers, biblionumbers
that don't exist). Confirm wording is appropriate in messages.
7) Add both barcodes and biblionumbers at the same time, confirm this
works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>
Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com>

Signed-off-by: Harold <harold.sabanal@gmail.com>

Signed-off-by: macon lauren KohaCon2017 <caballeromaricon@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Bug 17214: [FOLLOW-UP] Using Koha::Biblios instead of GetBiblio

Ready to test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 21 Marcel de Rooy 2017-10-27 07:35:42 UTC
Created attachment 68659 [details] [review]
Bug 17214: (QA follow-up) Print error message too in fallback case

If the error code is not known or empty, provide the message too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested this by adding a die on shelves.pl line 180 (my $added = eval ..)
Comment 22 Marcel de Rooy 2017-10-27 07:42:21 UTC
QA Comment:
No blocker, but having some doubts on this line:
if ($@) {
    push @messages, { bibnum => $biblionumber, type => 'alert', code => ref($@), msg => $@ };

For a regular die ref($@) is empty string, so code will be empty. 
If $@ is an object, the template only checks DBIx::Class::Exception.
But shelf store might raise a few Koha::Exceptions too..
Added a follow-up that at least adds message when code is empty.
Comment 23 Marcel de Rooy 2017-10-27 07:50:59 UTC
And yet another non-blocking comment/design issue:
If you add quite a number of biblio numbers, you will add an alert for each added record. They could easily make me ignore the warnings on errors. You could add an alert to tell me how many records were added instead; something for another report?
Comment 24 Jonathan Druart 2017-10-27 17:13:21 UTC
Pushed to master for 17.11, thanks to everybody involved!