[Bug 29946] New: Sort profiles alphabetically when staging MARC records for import
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Bug ID: 29946 Summary: Sort profiles alphabetically when staging MARC records for import Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org If you have a lot of MARC profiles for staging MARC records for import it would be nice if those profiles sorted alphabetically by name, so it would be easier to find the one you are looking for. -- 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=29946 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=29946 --- Comment #1 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 129813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129813&action=edit Bug 29946: Sort Marc profiles alphabetically To test: 1- Go to Tools > Stage MARC records for import 2- You'll need a MARC file, choose one and hit 'Upload file' 3- Create many Profiles with different names. I used ( ATop, ZTop, JTop, STop, etc. ) 4- Notice that the profiles sort in the order in which you create them 5- Apply patch 6- Try steps 1-2 again 7- Now the dropdown should be sorted alphabetically 8- Make a few more profiles and make sure they are being inserted in the right order alphabetically -- 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=29946 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | -- 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=29946 Florian <florian.bontemps@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |florian.bontemps@biblibre.c | |om -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129813|0 |1 is obsolete| | --- Comment #2 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Created attachment 130249 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130249&action=edit Bug 29946: Sort Marc profiles alphabetically To test: 1- Go to Tools > Stage MARC records for import 2- You'll need a MARC file, choose one and hit 'Upload file' 3- Create many Profiles with different names. I used ( ATop, ZTop, JTop, STop, etc. ) 4- Notice that the profiles sort in the order in which you create them 5- Apply patch 6- Try steps 1-2 again 7- Now the dropdown should be sorted alphabetically 8- Make a few more profiles and make sure they are being inserted in the right order alphabetically Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Barbara Johnson <barbara.johnson@bedfordtx.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |barbara.johnson@bedfordtx.g | |ov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am sorry, but while this works for A-z and therefor for English, it doesn't work for other languages like German with Umlauts or French with accents/diacritics. If you enter for example a description starting with Á, it will sort at the end, instead of as A. I think we need to use a sort that accounts for that and that we already have that in Koha - using cmp instead of >? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #3)
I am sorry, but while this works for A-z and therefor for English, it doesn't work for other languages like German with Umlauts or French with accents/diacritics. If you enter for example a description starting with Á, it will sort at the end, instead of as A.
I think we need to use a sort that accounts for that and that we already have that in Koha - using cmp instead of >?
Since we fetch this profiles from /api/v1/import_batch_profiles I think we need a way to sort these, with accents/diacritics, in JavaScript instead of Perl. I think localeCompare might be the answer: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obj... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Lucas Gass <lucas@bywatersolutions.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=29946 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130249|0 |1 is obsolete| | --- Comment #5 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 132200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132200&action=edit Bug 29946: Sort Marc profiles alphabetically To test: 1- Go to Tools > Stage MARC records for import 2- You'll need a MARC file, choose one and hit 'Upload file' 3- Create many Profiles with different names. Add some that include accents/diacritics. 4- Notice that the profiles sort in the order in which you create them 5- Apply patch 6- Try steps 1-2 again 7- Now the dropdown should be sorted alphabetically 8- Make a few more profiles and make sure they are being inserted in the right order alphabetically, including the profiles containing accents/diacritics. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Barbara Johnson <barbara.johnson@bedfordtx.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #6 from Barbara Johnson <barbara.johnson@bedfordtx.gov> --- I was able to create profiles using different accents and diacritics. And the sorting worked correctly. But I did run into problems with the following scenario. I tried to create several similarly named profiles such as the two sets listed below. I could only save one profile from each set. It seems that it isn't able to differentiate between a letter with and without accent marks. etest ètest étest abooks äbooks ábooks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 --- Comment #7 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Barbara Johnson from comment #6)
I was able to create profiles using different accents and diacritics. And the sorting worked correctly.
But I did run into problems with the following scenario. I tried to create several similarly named profiles such as the two sets listed below. I could only save one profile from each set. It seems that it isn't able to differentiate between a letter with and without accent marks.
etest ètest étest
abooks äbooks ábooks
I see what you mean. This happens with or without this patch. It also seems unrelated to diacritics as I can add a profile with a name like 'abook' but then I will get the error if I try 'Abook' or 'aBook'. In the error logs I see: [WARN] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'abook' for key 'u_import_batch_profiles__name' at /kohadevbox/koha/Koha/Object.pm line 170 Maybe we should file a separate bug for that issue? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132200|0 |1 is obsolete| | --- Comment #8 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 132240 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132240&action=edit Bug 29946: Sort Marc profiles alphabetically To test: 1- Go to Tools > Stage MARC records for import 2- You'll need a MARC file, choose one and hit 'Upload file' 3- Create many Profiles with different names. Add some that include accents/diacritics. 4- Notice that the profiles sort in the order in which you create them 5- Apply patch 6- Try steps 1-2 again 7- Now the dropdown should be sorted alphabetically 8- Make a few more profiles and make sure they are being inserted in the right order alphabetically, including the profiles containing accents/diacritics. Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Barbara Johnson <barbara.johnson@bedfordtx.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #9 from Barbara Johnson <barbara.johnson@bedfordtx.gov> --- Yes, that does sound like a separate issue. Everything worked as described with this patch so I am signing off on it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132240|0 |1 is obsolete| | --- Comment #10 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 133139 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133139&action=edit Bug 29946: Sort Marc profiles alphabetically To test: 1- Go to Tools > Stage MARC records for import 2- You'll need a MARC file, choose one and hit 'Upload file' 3- Create many Profiles with different names. Add some that include accents/diacritics. 4- Notice that the profiles sort in the order in which you create them 5- Apply patch 6- Try steps 1-2 again 7- Now the dropdown should be sorted alphabetically 8- Make a few more profiles and make sure they are being inserted in the right order alphabetically, including the profiles containing accents/diacritics. Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Signed Off |Passed QA --- Comment #11 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Works, qa script happy, code looks good, passing QA :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29946 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org