Summary: | ddc sorting of call numbers truncates long Cutter parts | ||
---|---|---|---|
Product: | Koha | Reporter: | giuseppe.angilella |
Component: | Cataloging | Assignee: | simith.doliveira |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, eric.begin, giuseppe.angilella, m.de.rooy, philippe.blouin, sandboxes, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 8837 | ||
Attachments: |
Bug 12424 - ddc sorting of call numbers truncates long Cutter parts
Patch updated. Rebase done. Bug 12424 - ddc sorting of call numbers truncates long Cutter parts Bug 12424 - ddc sorting of call numbers truncates long Cutter parts Bug 12424 - ddc sorting of call numbers truncates long Cutter parts [PASSED QA] Bug 12424 - ddc sorting of call numbers truncates long Cutter parts |
Description
giuseppe.angilella
2014-06-14 04:59:47 UTC
I've actually tried to modify the database, with alter table items modify cn_sort varchar(40) default null; Although this does enlarge the column's size (without seemingly affecting its present content), new cn_sort's still have exactly 30 characters at most, which seems to imply that Dewey.pm should also be modified. If that's right, this makes it a Cataloging issue, rather than a Database issue, and I am going to change the Component above of this bug or feature accordingly. After some trial and error, I've found out that it was not Dewey.pm which needs be modified, but /usr/share/koha/lib/C4/ClassSortRoutine.pm , where the dimension of the "key" variable is set to 30: it must be increased to 40, to comply with my previous change in the database: return substr($key, 0, 40); Summarizing, my sorting issue was solved by: 1. attaching the year part to the Cutter part by an underscore; this prevents Dewey.pm from treating the year part as the "second numeric part", and padding it with zeroes therefore; 1a. If the same author (author with the same Cutter) has other items, with record-specific Cutters, such as F435wh, these must be re-Cuttered as F435_wh; 2. items.cn_sort must be increased to 40 characters (modify Koha's database as described above); 3. the length of $key must also be increased to 40 (modify ClassSortRoutine.pm as described above). Do you foresee problem if we were increasing the length of cn_sort to 255 chars ? I wouldn't foresee any problem. Thanks for looking into that! I think this accidentally got switch to needs signoff, without having a patched attached to sign off on. Created attachment 30553 [details] [review] Bug 12424 - ddc sorting of call numbers truncates long Cutter parts This patch increases the cn_sort field length to 255 chars. Modified: C4/ClassSortRoutine.pm - change the hardcoded cn_sort length to 255 installer/data/mysql/kohastructure.sql - alter tables items and deleteditems installer/data/mysql/updatedatabase.pl - alter tables items and deleteditems Testing: Before applying the patch: 0) Select an item 1) Edit the item selected 2) Change "Full call number" option to 530 F435_1996 v2p1 3) Save changes 4) Valide 530_000000000000000_F435_1996_ (table items - cn_sort column). After applying the patch: 5) Edit again the item selected in 0 3) Save changes 4) Valide 530_000000000000000_F435_1996_V2P1 (table items - cn_sort column). I tried to test this patch with the sandbox system, but it does not work. Here is the result I've received from biblibre: The sandbox you've requested is not ready. Some problems occurred applying patches from bug 12424: <h1>Something went wrong !</h1>Applying: Bug 12424 - ddc sorting of call numbers truncates long Cutter parts Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging installer/data/mysql/updatedatabase.pl CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl Failed to merge in the changes. Patch failed at 0001 Bug 12424 - ddc sorting of call numbers truncates long Cutter parts When you have resolved this problem run git bz apply --continue. If you would prefer to skip this patch, instead run git bz apply --skip. To restore the original branch and stop patching run git bz apply --abort. Bug 12424 - ddc sorting of call numbers truncates long Cutter parts 30553 - Bug 12424 - ddc sorting of call numbers truncates long Cutter parts Apply? [(y)es, (n)o, (i)nteractive] Patch left in /tmp/Bug-12424---ddc-sorting-of-call-numbers-truncates--1zbYCL.patch . Created attachment 30734 [details] [review] Patch updated. Rebase done. Patch tested with a sandbox, by Giuseppe Angilella <giuseppe.angilella@ct.infn.it> Created attachment 30744 [details] [review] Bug 12424 - ddc sorting of call numbers truncates long Cutter parts This patch increases the cn_sort field length to 255 chars. Modified: C4/ClassSortRoutine.pm - change the hardcoded cn_sort length to 255 installer/data/mysql/kohastructure.sql - alter tables items and deleteditems installer/data/mysql/updatedatabase.pl - alter tables items and deleteditems Testing: Before applying the patch: 0) Select an item 1) Edit the item selected 2) Change "Full call number" option to 530 F435_1996 v2p1 3) Save changes 4) Valide 530_000000000000000_F435_1996_ (table items - cn_sort column). After applying the patch: 5) Edit again the item selected in 0 3) Save changes 4) Valide 530_000000000000000_F435_1996_V2P1 (table items - cn_sort column). Signed-off-by: Giuseppe Angilella <giuseppe.angilella@ct.infn.it> It seems to work: thank you very much for your efforts! Note: It is still necessary to include an underscore between the Cutter part and the year (or any further numerical string, other than the Dewey number proper, not prepended by an alphabetic character), i.e. "F435_1996" rather than "F435 1996". This patch is looking good, no problems spotted in code review. But there is one thing that I am not sure about: There is another cn_sort field in biblioitems and deletedbiblioitems that I feel should also be updated to avoid problems and make them all match. Could you provide a follow-up? Leaving this as Signed off for now. Created attachment 31065 [details] [review] Bug 12424 - ddc sorting of call numbers truncates long Cutter parts This patch increases the cn_sort field length to 255 chars. Modified: C4/ClassSortRoutine.pm - change the hardcoded cn_sort length to 255 installer/data/mysql/kohastructure.sql - alter tables items, biblioitems, deletedbiblioitems and deleteditems installer/data/mysql/updatedatabase.pl - alter tables items, biblioitems, deletedbiblioitems and deleteditems Testing: Before applying the patch: 0) Select an item 1) Edit the item selected 2) Change "Full call number" option to 530 F435_1996 v2p1 3) Save changes 4) Valide 530_000000000000000_F435_1996_ (table items - cn_sort column). After applying the patch: 5) Edit again the item selected in 0 3) Save changes 4) Valide 530_000000000000000_F435_1996_V2P1 (table items - cn_sort column). Hi Simith, this would have been better as a separate follow-up patch (follow-up usually meaning a new and separate patch that applies on the alreay existing patches). This way you could have kept the sign-off from Giuseppe. Ah, I had missed you switched back to 'needs sign-off' - so it's ok. Just trying to help with procedures - if QA asks for something, most of the time you can keep the 'signed off' status with a separate patch if the change is not too big. Created attachment 32364 [details] [review] Bug 12424 - ddc sorting of call numbers truncates long Cutter parts This patch increases the cn_sort field length to 255 chars. Modified: C4/ClassSortRoutine.pm - change the hardcoded cn_sort length to 255 installer/data/mysql/kohastructure.sql - alter tables items and deleteditems installer/data/mysql/updatedatabase.pl - alter tables items and deleteditems Testing: Before applying the patch: 0) Select an item 1) Edit the item selected 2) Change "Full call number" option to 530 F435_1996 v2p1 3) Save changes 4) Valide 530_000000000000000_F435_1996_ (table items - cn_sort column). After applying the patch: 5) Edit again the item selected in 0 3) Save changes 4) Valide 530_000000000000000_F435_1996_V2P1 (table items - cn_sort column). Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 32407 [details] [review] [PASSED QA] Bug 12424 - ddc sorting of call numbers truncates long Cutter parts This patch increases the cn_sort field length to 255 chars. Modified: C4/ClassSortRoutine.pm - change the hardcoded cn_sort length to 255 installer/data/mysql/kohastructure.sql - alter tables items and deleteditems, biblioitems and deletedbiblioitems installer/data/mysql/updatedatabase.pl - alter tables items and deleteditems, biblioitems and deletedbiblioitems Testing: Before applying the patch: 0) Select an item 1) Edit the item selected 2) Change "Full call number" option to 530 F435_1996 v2p1 3) Save changes 4) Valide 530_000000000000000_F435_1996_ (table items - cn_sort column). After applying the patch: 5) Edit again the item selected in 0 3) Save changes 4) Valide 530_000000000000000_F435_1996_V2P1 (table items - cn_sort column). Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes tests and QA script. Works as described. Thx for your patience! Patch pushed to master. Thanks Simith! |