When adding items (holdings), options on the dropdown list for Koha Item Type needs to be sorted by headings themselves not linked Codes.
Created attachment 46257 [details] [review] Bug 15337: Add tests to ensure that GetItemTypes will return element ordered by desc
Created attachment 46258 [details] [review] Bug 15337: Make itemtypes retrieved with GetItemTypes ordered by descriptions Prior to this patch, the itemtypes were displayed ordered by the code (itemtypes.itemtype DB column). This patch will make them displayed by the description displayed (the translated description). Test plan: 0/ Do not apply this patch set 1/ Confirm that the itemtypes are displayed ordered by code (when adding an item, cataloguing/additem.pl) 2/ Confirm that t/db_dependent/Koha.t does not pass 3/ Apply the test patch 4/ Confirm that t/db_dependent/Koha.t pass 5/ Confirm that the itemtypes are not displayed by description (on additem.pl)
Testing: Without patches: - Order in dropdown list of Koha item types is wrong (not alphabetically). - t/db_dependent/Koha.t passes green With first patch (tests): - t/db_dependent/Koha.t does not pass (not ok 10 - GetItemTypes test) (as expected) With second patch applied: - Order in dropdown is alphabetically (as expected) - t/db_dependent/Koha.t passes green (as expected) Going to sign off.
Created attachment 46274 [details] [review] Bug 15337: Add tests to ensure that GetItemTypes will return element ordered by desc See comment #3 Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 46275 [details] [review] Bug 15337: Make itemtypes retrieved with GetItemTypes ordered by descriptions Prior to this patch, the itemtypes were displayed ordered by the code (itemtypes.itemtype DB column). This patch will make them displayed by the description displayed (the translated description). Test plan: 0/ Do not apply this patch set 1/ Confirm that the itemtypes are displayed ordered by code (when adding an item, cataloguing/additem.pl) 2/ Confirm that t/db_dependent/Koha.t does not pass 3/ Apply the test patch 4/ Confirm that t/db_dependent/Koha.t pass 5/ Confirm that the itemtypes are not displayed by description (on additem.pl) See comment #3 Signed-off-by: Marc Véron <veron@veron.ch>
Hi Jonathan, this doesn't appear to work for me. I changed the english and the default description of my BK itemtype to "Z" - but it still appears first in list when adding a new item?
(In reply to Katrin Fischer from comment #6) > Hi Jonathan, this doesn't appear to work for me. I changed the english and > the default description of my BK itemtype to "Z" - but it still appears > first in list when adding a new item? Cannot recreate that. I have changed my "CD" description to "Z", then go to /cataloguing/additem.pl?op=edititem&biblionumber=1986&itemnumber=2990#edititem I have my 995$r set as r type de document et support matériel Tab:10, | Koha field: items.itype, Not repeatable, Mandatory, | Auth value:itemtypes
Hm, I will try and test again. Not sure what's going wrong. Another last idea - mine was not mandatory. I think that changes the look of the drop down a bit.
I have no idea why, but 'Zooks' stays on top of list in the edit item screen no matter what I do. :(
Could you try to debug around cataloguing/additem.pl l.178 to 190? The GetItemTypes subroutine is called to construct the item types. $itemtypes should be an arrayref of item types, ordered by descriptions.
I think it must have been some hidden whitespace. I reentered all descriptions, didn't notice an additional space, but after that - it works.
Created attachment 46497 [details] [review] [PASSED QA] Bug 15337: Add tests to ensure that GetItemTypes will return element ordered by desc See comment #3 Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 46498 [details] [review] [PASSED QA] Bug 15337: Make itemtypes retrieved with GetItemTypes ordered by descriptions Prior to this patch, the itemtypes were displayed ordered by the code (itemtypes.itemtype DB column). This patch will make them displayed by the description displayed (the translated description). Test plan: 0/ Do not apply this patch set 1/ Confirm that the itemtypes are displayed ordered by code (when adding an item, cataloguing/additem.pl) 2/ Confirm that t/db_dependent/Koha.t does not pass 3/ Apply the test patch 4/ Confirm that t/db_dependent/Koha.t pass 5/ Confirm that the itemtypes are not displayed by description (on additem.pl) See comment #3 Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master - thanks
Patches pushed to 3.22.x, will be in 3.22.2