Bug 18400: [QA Follow-up] Move sort outside the loop
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 12 May 2017 08:59:11 +0000 (10:59 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 12 May 2017 12:57:07 +0000 (08:57 -0400)
commite10a415ef92f69b2645866720e93fbbdd3c6672a
tree02393b0525b751588429527e7b744531b050d28c
parent91171650ac980415d9d2976fa6b19365fe545b37
Bug 18400: [QA Follow-up] Move sort outside the loop

GetItemTypesCategorized can return descriptions that are still undef since
Authorized values does not enforce a description in lib and lib_opac.
When I add one ITEMTYPECAT auth value without descriptions, I can still
generate the string comparison warnings on the itemtypes sort.
In order to prevent the warning, we should add an empty string in the
assignment on line 229.

We do not need to copy the itemtypes hash if we move the sort outside the
@advanced_search_types foreach. There is no need to sort it more than once.
Note that I did not see any reasons btw for corruption of the structure
inside this loop.

Note: If we use ITEMTYPECAT without descriptions, we should probably leave
them out. No need to show a checkbox without description on Advanced Search,
but I would recommend to solve that on its own report. The whole ITEMTYPECAT
functionality has imo not been designed properly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
opac/opac-search.pl