Bug 27843

Summary: Editing item's Collection code sets items.cn_sort to NULL
Product: Koha Reporter: Paul Milazzo <pgm0203>
Component: Staff interfaceAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, mkstephens
Version: 20.11   
Hardware: Other   
OS: Linux   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27509
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Current Server Information

Description Paul Milazzo 2021-03-02 20:36:00 UTC
Created attachment 117551 [details]
Current Server Information

Moving a single item to a different collection---by editing the item in the Staff Interface and selecting a different value in the Collection code menu---has the side effect of setting the items.cn_sort field for that item to NULL. As a result, the item disappears from the OPAC shelf browser, and initiating shelf browsing from that item fails. For example, moving Item 681 from ART to NFIC:

Before:
+------------+-------+--------------------+-----------------------+
| itemnumber | ccode | itemcallnumber     | cn_sort               |
+------------+-------+--------------------+-----------------------+
|        681 | ART   | ND553.R45 A4 2010a | ND0553 R45 A4  02010A |
+------------+-------+--------------------+-----------------------+

After:
+------------+-------+--------------------+---------+
| itemnumber | ccode | itemcallnumber     | cn_sort |
+------------+-------+--------------------+---------+
|        681 | NFIC  | ND553.R45 A4 2010a | NULL    |
+------------+-------+--------------------+---------+

After manually restoring the content of the items.cn_sort field, the item reappears in the shelf browser in the destination collection.

I'm running Koha 20.11 on a Raspberry Pi 4B (it's my personal library). I have ShelfBrowserUsesCcode turned on and use LoC Classification for call numbers. I have attached my current Server Information.
Comment 1 Jonathan Druart 2021-03-11 07:52:16 UTC
Hi Paul,
Which exact version of Koha are you using?
It seems that it's fixed by bug 27509 (that is in 21.05.00, 20.11.02 and 20.05.08)
Comment 2 Myka Kennedy Stephens 2021-03-11 12:45:17 UTC
I can confirm that this is fixed by the patch for bug 27509 on 20.05.08.
Comment 3 Jonathan Druart 2021-03-11 13:16:13 UTC

*** This bug has been marked as a duplicate of bug 27509 ***