Bug 5661

Summary: Authority search return an "Error 500" when "Sort by" is set to "No order"
Product: Koha Reporter: Frédérick Capovilla <fcapovilla>
Component: SearchingAssignee: Frédérick Capovilla <fcapovilla>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: PATCH-Sent (DO NOT USE) CC: chris, julian.maurice
Version: rel_3_2   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch

Description Frédérick Capovilla 2011-01-26 15:33:39 UTC
Created attachment 3026 [details] [review]
Proposed patch

This error can be reproduced in two places :

In authorities/authorities-home.pl :
Do any authority search using "None" as a sort order. Error 500 is returned.

In authorities/auth_finder.pl :
( When adding or modifying a MARC record, click on the "..." next to the 100$a field to do an authority search and get to this page. )
Do any authority search using "No order" for the "Sort by" field. Error 500 is returned.


This happens because on line 267 of AuthoritiesMarc.pm, a "@or" is added to the
query even when $orderstring is empty, which invalidates the query.

Patch attached to fix the problem.


Note : 
Because there was another bug affecting the way search queries are constructed ( Bug 4309 ) Error 500s might be caused by the number of search terms AND by this bug.
Comment 1 Chris Cormack 2011-02-02 21:33:59 UTC
Pushed, please test
Comment 2 MJ Ray (software.coop) 2011-03-05 10:34:25 UTC
This bug is mentioned in:
Bug 5661 Fix a problem when	doing an authority search with no sort order http://lists.koha-community.org/pipermail/koha-patches/2011-February/013744.html
Bug 5661 Fix a problem when	doing an authority search with no sort order http://lists.koha-community.org/pipermail/koha-patches/2011-February/013745.html