[Bug 26867] New: Holds to Pull should use cn_sort
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Bug ID: 26867 Summary: Holds to Pull should use cn_sort Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Staff Client Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com To recreate: - create three bibs, each with one item. those items should have these call numbers: -- JC43 .G6 1890 -- JC330 .F74 2000 -- JC480 .R63 2006 - place an item level hold on each item - go to Holds To Pull, sort by call number - notice items are order incorrectly, going 330, 43, 480 - use a report to pull the cn_sort values for your 3 items, confirm that ordering by cn_sort in your report correctly orders them 43, 330, 480 We should use cn_sort here to get them in the correct order. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=25897 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 SamSowanick <sam.sowanick@corvallisoregon.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sam.sowanick@corvallisorego | |n.gov --- Comment #1 from SamSowanick <sam.sowanick@corvallisoregon.gov> --- +1 We are seeing improperly sorted items on our picklist. If sorting by CN_SORT solves this, I think it would be a good idea. I don't know how to do this but hope this comment bumps this closer to a developers lap :). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #2 from Andrii Nugged <nugged@gmail.com> --- Created attachment 203938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203938&action=edit Bug 26867: Sort Holds to pull by cn_sort Holds to pull renders one row per bibliographic record and can list several available call numbers in that row. DataTables currently compares the displayed call number text, so classification numbers such as JC43 and JC330 are ordered as JC330, JC43. Order the available call numbers by their normalized classification keys and expose the first key through the table cell's data-order attribute. If an older item has no cn_sort value, retain its displayed call number as the fallback sort key. Add a self-contained Cypress regression for ascending and descending row sorting, aggregated call numbers, and the missing-cn_sort fallback. Test plan: Before applying the patch: 1. Create three bibliographic records with one item each. 2. Give the items the call numbers JC43 .G6 1890, JC330 .F74 2000, and JC480 .R63 2006. 3. Use LOC as the classification source for each item. 4. Place a hold on each bibliographic record. 5. Go to Circulation > Holds to pull. 6. Sort the Available call numbers column in ascending order. 7. Confirm that the items appear as JC330, JC43, JC480. Apply the patch. After applying the patch: 1. Return to Circulation > Holds to pull. 2. Sort the Available call numbers column in ascending order. 3. Confirm that the items appear as JC43, JC330, JC480. Automated tests: 1. yarn cypress run --spec \ t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts 2. prove -I. -It/lib t/db_dependent/Koha/Holds.t Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nugged@gmail.com |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Everything works as per the test plan, except the tests were sometimes failing, so have Failed QA: 1. Cypress tests were sometimes failing for me (ran several times - sometimes passed, sometimes didn't - screenshot attached): cypress run --spec t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts circ/pendingreserves call number sorting 1) sorts rows and aggregated values by classification sort keys 0 passing (13s) 1 failing 1) circ/pendingreserves call number sorting sorts rows and aggregated values by classification sort keys: AssertionError: Timed out retrying after 10000ms: expected '<th.dt-orderable-asc.dt-orderable-desc>' to have attribute 'aria-sort' at Context.eval (webpack://koha/./t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts:182:50) 2. Not sure of the difference running tests with or without yarn in front. 3. Also, why prove -I. -It/lib t/db_dependent/Koha/Holds.t, instead of just prove t/db_dependent/Koha/Holds.t ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 203966 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203966&action=edit Screenshot - Test result failure Screenshot when test fails. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #5 from Andrii Nugged <nugged@gmail.com> --- Created attachment 211996 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211996&action=edit Bug 26867: Add HoldsCallnumberSortToPull preference Define classification and alphabetical call number ordering for the Holds to pull report. The default is classification, using cn_sort. Seed the preference on fresh installations, add an idempotent atomic update that preserves configured values, and expose the choices under Circulation > Holds policy. Test plan: 1. Run the database updater and search system preferences for HoldsCallnumberSortToPull. Confirm classification is selected. 2. Save alphabetical, rerun the atomic update, and confirm the value remains alphabetical. 3. Confirm the fresh-install seed defines the same default. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #6 from Andrii Nugged <nugged@gmail.com> --- Created attachment 211997 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211997&action=edit Bug 26867: Sort Holds to pull by the selected call number key The report sorts displayed call numbers as plain text. Classification numbers such as JC43 and JC330 consequently appear in the wrong order. Use cn_sort in classification mode and the displayed call number in alphabetical mode, for both aggregated values and table row ordering. Fall back to the displayed value for missing or empty classification keys, preserving a valid zero key. Keep displayed call numbers unchanged. Exercise both modes, ascending and descending order, aggregated items, missing sort keys, and restored table state with a preceding column hidden. Test plan: Before applying the patch: 1. Create available items with LCC call numbers JC43 .G6 1890, JC330 .F74 2000 and JC480 .R63 2006. Place holds on them. 2. Open Circulation > Holds to pull and sort Available call numbers. 3. Confirm ascending order is JC330, JC43, JC480. Apply the series and run the database updater. After applying the patch: 1. Set HoldsCallnumberSortToPull to classification in system preferences. 2. Reopen the report and sort Available call numbers. Confirm ascending JC43, JC330, JC480 and the reverse order when descending. 3. Save alphabetical in system preferences and reopen the report. Confirm ascending JC330, JC43, JC480 and its reverse when descending. 4. Restore classification and confirm the classification order returns. 5. Run t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203938|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=44152 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #7 from Andrii Nugged <nugged@gmail.com> --- David, the patches above replace the old version. I've reworked the Cypress test: it waits for the table redraw and checks both sorting modes, including restored state with a hidden column. The same spec fails on the old sorting and passes all four cases with the revised patches. Could you give it another run? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211996|0 |1 is obsolete| | Attachment #211997|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 212155 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212155&action=edit Bug 26867: Add HoldsCallnumberSortToPull preference Define classification and alphabetical call number ordering for the Holds to pull report. The default is classification, using cn_sort. Seed the preference on fresh installations, add an idempotent atomic update that preserves configured values, and expose the choices under Circulation > Holds policy. Test plan: 1. Run the database updater and search system preferences for HoldsCallnumberSortToPull. Confirm classification is selected. 2. Save alphabetical, rerun the atomic update, and confirm the value remains alphabetical. 3. Confirm the fresh-install seed defines the same default. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 212156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212156&action=edit Bug 26867: Sort Holds to pull by the selected call number key The report sorts displayed call numbers as plain text. Classification numbers such as JC43 and JC330 consequently appear in the wrong order. Use cn_sort in classification mode and the displayed call number in alphabetical mode, for both aggregated values and table row ordering. Fall back to the displayed value for missing or empty classification keys, preserving a valid zero key. Keep displayed call numbers unchanged. Exercise both modes, ascending and descending order, aggregated items, missing sort keys, and restored table state with a preceding column hidden. Test plan: Before applying the patch: 1. Create available items with LCC call numbers JC43 .G6 1890, JC330 .F74 2000 and JC480 .R63 2006. Place holds on them. 2. Open Circulation > Holds to pull and sort Available call numbers. 3. Confirm ascending order is JC330, JC43, JC480. Apply the series and run the database updater. After applying the patch: 1. Set HoldsCallnumberSortToPull to classification in system preferences. 2. Reopen the report and sort Available call numbers. Confirm ascending JC43, JC330, JC480 and the reverse order when descending. 3. Save alphabetical in system preferences and reopen the report. Confirm ascending JC330, JC43, JC480 and its reverse when descending. 4. Restore classification and confirm the classification order returns. 5. Run t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed --- Comment #10 from David Nind <david@davidnind.com> --- The missing step to make this work with the current test plan is to: 1. Set "2 - Source of classification or shelving scheme" to "Library of Congress Classification" for the item you add the call number to. Note: When creating a new record, the 942$2 defaults to DDC (for the BKS framework), and the "2 - Source of classification or shelving scheme" for a new item defaults to DDC. Something for QA: 1. The new system preference defaults to "by classification sort key (cn_sort)". 2. The current default behavour before the patches is to sort "alphabetically (as plain text)". 3. I thought the general rule was new system preferences shouldn't change the existing behavour. I don't mind what the default is set at (and in some ways it makes sense to make it default to the order that actually works), but this is the opposite of bug 44152, which sets the default for that bugs new system preference to "alphabetically (as plain text)". Whichever way is chosen, it should be the same for both bugs (in my opinion 8-)). Testing notes (using KTD): 1. Step 3 of the first patch test plan "Confirm the fresh-install seed defines the same default.": I assume this means that for a fresh install, the default setting for the new HoldsCallnumberSortToPull system preference is "by classification sort key (cn_sort)". To do this run reset_all in KTD with the patches applied, and check the default system preference value. 2. When adding the suggested call numbers to items, change "2 - Source of classification or shelving scheme" to "Library of Congress Classification", otherwise there is no change in the sort order with the new system preference. 3. Sample items edited with call numbers and holds placed for Mary Burton for pickup at Centerville: - Programming Perl (262): 39999000011418 - JC43 .G6 1890 - Intermediate Perl (126): 39999000005134 - JC330 .F74 2000 - Perl template toolkit (255): 39999000011111 - JC480 .R63 2006 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203966|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #11 from Andrii Nugged <nugged@gmail.com> --- Created attachment 212168 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212168&action=edit Bug 26867: Preserve alphabetical sorting by default Keep the report's previous plain-text ordering unless a library selects classification sorting. Use alphabetical for fresh installations and new preference creation, and for missing, empty or unrecognized values. Preserve every existing saved preference value on upgrade. Create the Cypress items through Koha's item API so their LCC keys are generated by Item->store. Keep direct database overrides only for the missing and empty key controls. Cover both sorting modes and the unconfigured preference cases. Test plan: Continue the report checks in the preceding patch, with this correction: 1. Edit each of the three test items. 2. Set "2 - Source of classification or shelving scheme" to "Library of Congress Classification". 3. Save the item before opening the report. On a fresh installation, or an upgrade where the preference does not yet exist, confirm HoldsCallnumberSortToPull starts as "alphabetically (as plain text)". Selecting "by classification sort key (cn_sort)" should give JC43, JC330, JC480 in ascending order. Alphabetical should give JC330, JC43, JC480. Check the reverse orders too. An existing saved classification value must survive the upgrade. Automated tests: yarn cypress run --spec \ t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #12 from Andrii Nugged <nugged@gmail.com> --- Thanks for catching the missing LCC step, David. It's explicit in both test plans now, and the tests generate keys through Koha. The follow-up keeps alphabetical sorting as the default, matching the holds queue and the reports' previous behaviour. Existing saved choices are preserved. Both modes pass the report checks and automated tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212155|0 |1 is obsolete| | Attachment #212156|0 |1 is obsolete| | Attachment #212168|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #13 from David Nind <david@davidnind.com> --- Created attachment 212175 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212175&action=edit Bug 26867: Add HoldsCallnumberSortToPull preference Define classification and alphabetical call number ordering for the Holds to pull report. The default is classification, using cn_sort. Seed the preference on fresh installations, add an idempotent atomic update that preserves configured values, and expose the choices under Circulation > Holds policy. Test plan: 1. Run the database updater and search system preferences for HoldsCallnumberSortToPull. Confirm classification is selected. 2. Save alphabetical, rerun the atomic update, and confirm the value remains alphabetical. 3. Confirm the fresh-install seed defines the same default. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #14 from David Nind <david@davidnind.com> --- Created attachment 212176 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212176&action=edit Bug 26867: Sort Holds to pull by the selected call number key The report sorts displayed call numbers as plain text. Classification numbers such as JC43 and JC330 consequently appear in the wrong order. Use cn_sort in classification mode and the displayed call number in alphabetical mode, for both aggregated values and table row ordering. Fall back to the displayed value for missing or empty classification keys, preserving a valid zero key. Keep displayed call numbers unchanged. Exercise both modes, ascending and descending order, aggregated items, missing sort keys, and restored table state with a preceding column hidden. Test plan: Before applying the patch: 1. Create available items with LCC call numbers JC43 .G6 1890, JC330 .F74 2000 and JC480 .R63 2006. Place holds on them. 2. Open Circulation > Holds to pull and sort Available call numbers. 3. Confirm ascending order is JC330, JC43, JC480. Apply the series and run the database updater. After applying the patch: 1. Set HoldsCallnumberSortToPull to classification in system preferences. 2. Reopen the report and sort Available call numbers. Confirm ascending JC43, JC330, JC480 and the reverse order when descending. 3. Save alphabetical in system preferences and reopen the report. Confirm ascending JC330, JC43, JC480 and its reverse when descending. 4. Restore classification and confirm the classification order returns. 5. Run t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #15 from David Nind <david@davidnind.com> --- Created attachment 212177 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212177&action=edit Bug 26867: Preserve alphabetical sorting by default Keep the report's previous plain-text ordering unless a library selects classification sorting. Use alphabetical for fresh installations and new preference creation, and for missing, empty or unrecognized values. Preserve every existing saved preference value on upgrade. Create the Cypress items through Koha's item API so their LCC keys are generated by Item->store. Keep direct database overrides only for the missing and empty key controls. Cover both sorting modes and the unconfigured preference cases. Test plan: Continue the report checks in the preceding patch, with this correction: 1. Edit each of the three test items. 2. Set "2 - Source of classification or shelving scheme" to "Library of Congress Classification". 3. Save the item before opening the report. On a fresh installation, or an upgrade where the preference does not yet exist, confirm HoldsCallnumberSortToPull starts as "alphabetically (as plain text)". Selecting "by classification sort key (cn_sort)" should give JC43, JC330, JC480 in ascending order. Alphabetical should give JC330, JC43, JC480. Check the reverse orders too. An existing saved classification value must survive the upgrade. Automated tests: yarn cypress run --spec \ t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |andrew@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212175|0 |1 is obsolete| | Attachment #212176|0 |1 is obsolete| | Attachment #212177|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #16 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212447 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212447&action=edit Bug 26867: Add HoldsCallnumberSortToPull preference Define classification and alphabetical call number ordering for the Holds to pull report. The default is classification, using cn_sort. Seed the preference on fresh installations, add an idempotent atomic update that preserves configured values, and expose the choices under Circulation > Holds policy. Test plan: 1. Run the database updater and search system preferences for HoldsCallnumberSortToPull. Confirm classification is selected. 2. Save alphabetical, rerun the atomic update, and confirm the value remains alphabetical. 3. Confirm the fresh-install seed defines the same default. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #17 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212448 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212448&action=edit Bug 26867: Sort Holds to pull by the selected call number key The report sorts displayed call numbers as plain text. Classification numbers such as JC43 and JC330 consequently appear in the wrong order. Use cn_sort in classification mode and the displayed call number in alphabetical mode, for both aggregated values and table row ordering. Fall back to the displayed value for missing or empty classification keys, preserving a valid zero key. Keep displayed call numbers unchanged. Exercise both modes, ascending and descending order, aggregated items, missing sort keys, and restored table state with a preceding column hidden. Test plan: Before applying the patch: 1. Create available items with LCC call numbers JC43 .G6 1890, JC330 .F74 2000 and JC480 .R63 2006. Place holds on them. 2. Open Circulation > Holds to pull and sort Available call numbers. 3. Confirm ascending order is JC330, JC43, JC480. Apply the series and run the database updater. After applying the patch: 1. Set HoldsCallnumberSortToPull to classification in system preferences. 2. Reopen the report and sort Available call numbers. Confirm ascending JC43, JC330, JC480 and the reverse order when descending. 3. Save alphabetical in system preferences and reopen the report. Confirm ascending JC330, JC43, JC480 and its reverse when descending. 4. Restore classification and confirm the classification order returns. 5. Run t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26867 --- Comment #18 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212449 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212449&action=edit Bug 26867: Preserve alphabetical sorting by default Keep the report's previous plain-text ordering unless a library selects classification sorting. Use alphabetical for fresh installations and new preference creation, and for missing, empty or unrecognized values. Preserve every existing saved preference value on upgrade. Create the Cypress items through Koha's item API so their LCC keys are generated by Item->store. Keep direct database overrides only for the missing and empty key controls. Cover both sorting modes and the unconfigured preference cases. Test plan: Continue the report checks in the preceding patch, with this correction: 1. Edit each of the three test items. 2. Set "2 - Source of classification or shelving scheme" to "Library of Congress Classification". 3. Save the item before opening the report. On a fresh installation, or an upgrade where the preference does not yet exist, confirm HoldsCallnumberSortToPull starts as "alphabetically (as plain text)". Selecting "by classification sort key (cn_sort)" should give JC43, JC330, JC480 in ascending order. Alphabetical should give JC330, JC43, JC480. Check the reverse orders too. An existing saved classification value must survive the upgrade. Automated tests: yarn cypress run --spec \ t/cypress/integration/KohaTable/PendingHoldsCallNumbers_spec.ts Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org