Bug 18499 - 'Call Number Browser' on edit items screen uses the default classification source rather than the item specific source
Summary: 'Call Number Browser' on edit items screen uses the default classification so...
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-26 23:29 UTC by Barton Chittenden
Modified: 2020-03-10 22:17 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.04, 19.05.09


Attachments
Bug 18499: Use items cn_source in cn_browser.pl (7.22 KB, patch)
2020-02-06 13:20 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18499: Use items cn_source in cn_browser.pl (7.29 KB, patch)
2020-02-12 01:54 UTC, Myka Kennedy Stephens
Details | Diff | Splinter Review
Bug 18499: (follow-up) Add missing filters (1.64 KB, patch)
2020-02-14 18:00 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18499: Use items cn_source in cn_browser.pl (7.34 KB, patch)
2020-02-15 09:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18499: (follow-up) Add missing filters (1.70 KB, patch)
2020-02-15 09:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18499: (QA follow-up) Add missing colon after label description (1.41 KB, patch)
2020-02-15 09:02 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Barton Chittenden 2017-04-26 23:29:56 UTC
To replicate:

Find items which are on the same shelf in using the opac shelf browser, but whose items.itemcallnumber do not sort the same way alphanumerically.

Edit one of the items, click on the elipses ( ... ) next to itemcallnumber in the edit items screen. This will bring up a 'Call numbers browser' screen.

These will not be sorted the same way that they are sorted in the opac shelf browser.
Comment 1 Nick Clemens 2018-03-21 15:30:31 UTC
Need to model changes here on https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19915

Once that is PQA I will work on this one
Comment 2 Nick Clemens 2019-10-11 01:21:58 UTC
To clarify, in a system with mixed classification sources the callnumber browser uses the DefaultClassificationSource defined in the sysprefs for all browsing.

This is problematic in some situations, for instance:
'2017 SCHM' is a generic callnumber, if you set the Default to 'LOC' you get back a blank string

To recreate:
1 - Set DefaultClassificationSource to LOC
2 - perl -e "use C4::ClassSource; print GetClassSort( undef, undef, '2017 SCHM' );"
3 - You get no feedback
4 - Set DefaultClass.. to Dewey
5 - repeat #2
6 - You get a populated string
Comment 3 Nick Clemens 2020-02-06 13:20:58 UTC
Created attachment 98531 [details] [review]
Bug 18499: Use items cn_source in cn_browser.pl

This does a few things:
 * We fetch the cn_sort from the DB and use this rather than calculating based on DefaultClassificationSource
   We were already pulling based on the items source, so this should not change things
 * Rather than using JS to submit the form, it submits via html
 * Fix subtitle display and add barcode (it was retrieved in one query but not used)
 * Add option to apply different classification scheme to the search

To test:
 1 - Add cn_browser.pl to the 'plugin' field in a framework for 952$o
 2 - Edit an item on a record in that framework
 3 - Enter an itemcallnumber
 4 - Click the two dots to launch the callnumber browser
 5 - Note the results
 6 - Apply patch
 7 - Repeat
 8 - Note subtitles and barcodes are displayed in results
 9 - Note callnumbers are appropriate
10 - Try changing the class source used
11 - Try this with differing dewey,lcc, and other callnumbers
12 - Ensure results are as expected
Comment 4 Myka Kennedy Stephens 2020-02-12 01:54:32 UTC
Created attachment 98737 [details] [review]
Bug 18499: Use items cn_source in cn_browser.pl

This does a few things:
 * We fetch the cn_sort from the DB and use this rather than calculating based on DefaultClassificationSource
   We were already pulling based on the items source, so this should not change things
 * Rather than using JS to submit the form, it submits via html
 * Fix subtitle display and add barcode (it was retrieved in one query but not used)
 * Add option to apply different classification scheme to the search

To test:
 1 - Add cn_browser.pl to the 'plugin' field in a framework for 952$o
 2 - Edit an item on a record in that framework
 3 - Enter an itemcallnumber
 4 - Click the two dots to launch the callnumber browser
 5 - Note the results
 6 - Apply patch
 7 - Repeat
 8 - Note subtitles and barcodes are displayed in results
 9 - Note callnumbers are appropriate
10 - Try changing the class source used
11 - Try this with differing dewey,lcc, and other callnumbers
12 - Ensure results are as expected

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Comment 5 Myka Kennedy Stephens 2020-02-12 01:58:26 UTC
This patch works as expected. I tested with Dewey, LC, and home-grown alpha-numeric call numbers using the 'z Other/Generic classification scheme' and the results were all as expected. I wish I had a larger database of call numbers to test this with to be 100% certain, but from what I could test in the test database it works great and looks like a huge improvement on the current call number browser.

Thank you for your great work!
Comment 6 Katrin Fischer 2020-02-14 17:36:22 UTC
Sorry, Nick:

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt
   FAIL	  filters
		missing_filter at line 23 (        <input name="popup" type="hidden" value="[% popup %]"/>)
		missing_filter at line 55 (            [% IF ( cn_loo.barcode ) %] ([% cn_loo.barcode %])[% END %])
Comment 7 Nick Clemens 2020-02-14 18:00:23 UTC
Created attachment 99000 [details] [review]
Bug 18499: (follow-up) Add missing filters
Comment 8 Katrin Fischer 2020-02-15 09:02:02 UTC
Created attachment 99057 [details] [review]
Bug 18499: Use items cn_source in cn_browser.pl

This does a few things:
 * We fetch the cn_sort from the DB and use this rather than calculating based on DefaultClassificationSource
   We were already pulling based on the items source, so this should not change things
 * Rather than using JS to submit the form, it submits via html
 * Fix subtitle display and add barcode (it was retrieved in one query but not used)
 * Add option to apply different classification scheme to the search

To test:
 1 - Add cn_browser.pl to the 'plugin' field in a framework for 952$o
 2 - Edit an item on a record in that framework
 3 - Enter an itemcallnumber
 4 - Click the two dots to launch the callnumber browser
 5 - Note the results
 6 - Apply patch
 7 - Repeat
 8 - Note subtitles and barcodes are displayed in results
 9 - Note callnumbers are appropriate
10 - Try changing the class source used
11 - Try this with differing dewey,lcc, and other callnumbers
12 - Ensure results are as expected

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2020-02-15 09:02:06 UTC
Created attachment 99058 [details] [review]
Bug 18499: (follow-up) Add missing filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2020-02-15 09:02:10 UTC
Created attachment 99059 [details] [review]
Bug 18499: (QA follow-up) Add missing colon after label description

To match the line above, a colon (:) was added after the description:

Callnumber classification scheme: [pull down]

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Martin Renvoize 2020-02-17 11:31:56 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 12 Joy Nelson 2020-03-05 01:44:36 UTC
Pushed to 19.11.x for 19.11.04
Comment 13 Lucas Gass 2020-03-10 22:17:42 UTC
backported to 19.05.x for 19.05.09