Bug 5661 - Authority search return an "Error 500" when "Sort by" is set to "No order"
Summary: Authority search return an "Error 500" when "Sort by" is set to "No order"
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: rel_3_2
Hardware: All All
: PATCH-Sent (DO NOT USE) normal (vote)
Assignee: Frédérick Capovilla
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-26 15:33 UTC by Frédérick Capovilla
Modified: 2012-10-25 23:04 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed patch (1.03 KB, patch)
2011-01-26 15:33 UTC, Frédérick Capovilla
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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