Bug 4309

Summary: Authorities : Multiple values search leads to Error 500
Product: Koha Reporter: Henri-Damien LAURENT <henridamien>
Component: SearchingAssignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: PATCH-Sent (DO NOT USE) CC: chris, f.demians, fcapovilla, julian.maurice
Version: rel_3_2   
Hardware: PC   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: patch proposed
Revised patch

Description Chris Cormack 2010-05-21 01:25:39 UTC


---- Reported by henridamien@koha-fr.org 2010-03-09 10:18:58 ----

In cataloging, when cataloging a biblio.
When looking for an authority, entering data to select on Main Entry AND anywhere would lead to an ERROR 500.
This is owed to the fact that the Z3950 query produced is ill formed.



---- Additional Comments From henridamien@koha-fr.org 2010-03-09 10:22:37 ----

Created an attachment
patch proposed





---- Additional Comments From katrin.fischer@bsz-bw.de 2010-03-10 15:42:21 ----

*** http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4191 has been marked as a duplicate of this bug. ***



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:25 UTC  ---

This bug was previously known as _bug_ 4309 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4309
Imported an attachment (id=2000)

Actual time not defined. Setting to 0.0
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
The original submitter of attachment 2000 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Colin Campbell 2011-01-06 17:42:23 UTC
Created attachment 2957 [details] [review]
Revised patch

Earlier patch removed the error as reported in the attachment in bug 4191, but was generating errors when only 1 field searched. With this patch I can search 
William and Shakespeare or just Shakespeare without errors.

Plenty of room for refactoring SearchAithorities however. Not sure the authority search options are well enough defined
Comment 2 Chris Cormack 2011-01-24 07:44:45 UTC
Tested locally works well, pushed please test
Comment 3 Frédéric Demians 2011-01-25 07:24:18 UTC
*** Bug 5615 has been marked as a duplicate of this bug. ***
Comment 4 Frédéric Demians 2011-01-25 07:25:25 UTC
The patch works for UNIMARC DB.
Comment 5 Frédérick Capovilla 2011-01-25 18:28:36 UTC
Tested on my instance and it is working.

Since Bug 5615 was closed, I'd like to add one detail that the patch I attached with it also corrected :
In this same authority search window, if the value of "Sort by" is set to "No order", I get an error 500.
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.

Could anyone look into that? I don't know if I should create another bug report for that similar problem.
Comment 6 Frédéric Demians 2011-01-25 19:02:41 UTC
> Could anyone look into that? I don't know if I should create another bug report
> for that similar problem.

Yes, you should open a separate bug.
Comment 7 MJ Ray (software.coop) 2011-02-04 09:14:02 UTC
This bug is mentioned in:
Bug 4309 Do not throw error on auth search	of multiple fields http://lists.koha-community.org/pipermail/koha-patches/2011-January/013539.html
Bug 4309 Do not throw error on auth search	of multiple fields http://lists.koha-community.org/pipermail/koha-patches/2011-January/013700.html