]> git.koha-community.org Git - koha.git/commit
Bug 10656: (follow-up) handle OPAC sorting of authvals where lib_opac is NULL
authorGalen Charlton <gmc@esilibrary.com>
Tue, 20 Aug 2013 17:18:13 +0000 (17:18 +0000)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 16 Sep 2013 13:34:45 +0000 (10:34 -0300)
commit21d119735b1eda634b4ca4760da247b960ae0c9c
tree0d6856b7677468585cc0a02adbf2b880da91f85b
parent534aa49297dc3dc1b9ab698743be1ce55eb0965f
Bug 10656: (follow-up) handle OPAC sorting of authvals where lib_opac is NULL

The OPAC description for an authorized value is not required to be
populated.  In particular, if it is NULL, the staff description is
displayed instead.

This patch makes sure that the sort order (in OPAC mode) uses either
the staff description or the OPAC description as needed for each
value.

To test:

[1] Make sure that AdvancedSearchTypes includes "ccode"
[1] Arrange your CCODE values so the sort order for staff labels
    is different from the sort order for OPAC descriptions.  Also,
    ensure that one of the OPAC descriptions is NULL.  For example,

    authorised_value | lib     | lib_opac
    --------------------------------------
    ZZZ              | A_STAFF | Z_PUBLIC
    DDD              | D_STAFF | NULL
    AAA              | Z_STAFF | A_PUBLIC

[2] Prior to the patch, any CCODE values where the OPAC description
    is NULL will sort first in the OPAC advanced search page, even
    if the displayed label shouldn't come first.
[3] Apply the patch.
[4] Verify that the collection list on the OPAC advanced search page
    is now correct.
[5] Verify that the sort order on the staff advanced search page
    has not changed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, tested in staff and OPAC.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0c67e94c8b8dbe1912fd5ba4b503cf53789b75a5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Koha.pm