[Koha-bugs] [Bug 29418] Zebra clean_search_term does not clean search and so results in error

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 12 01:45:32 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29418

--- Comment #15 from David Cook <dcook at prosentient.com.au> ---
(In reply to Martin Renvoize from comment #11)
> [WARN] CCL parsing error (10014) Unknown qualifier ZOOM for query:
> Host-item=( Utensili = ) at /home/koha/kohaclone/C4/Search.pm line 242.
> [2022/05/09 12:39:13] [WARN] Warning from simple_search_compat: 'CCL parsing
> error (10014) Unknown qualifier ZOOM' at /home/koha/kohaclone/Koha/Biblio.pm
> line 540.

This warning actually reveals that we're going about this the wrong way.

Take this code:

$searchstr = "Host-item:($cleaned_title)";

We're just injecting an arbitrary string between those parentheses, and that's
causing parsing errors. 

What we should be doing is this:

$searchstr = qq#Host-item:("$cleaned_title")#;

Observe the difference:

Z> find Host-item=( Utensili = )
CCL ERROR: Unknown qualifier
Z> find Host-item=(" Utensili = ")
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 0, setno 2
SearchResult-1: term=Utensili cnt=0
records returned: 0
Elapsed: 0.000349

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list