From 914001ef73c800593406491d68f37bebb8b4d69e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 13 Mar 2013 11:22:34 -0400 Subject: [PATCH] Bug 9810 - Search limit 'available' does not hide damaged or withdrawn items Test Plan: 1) Perform a search that will return an a damaged item and a withdrawn item ( for simplicity, have those items be the only one on each record, respectively ) 2) Run the same search but limit to available items only 3) Note those items still appear in the search results 4) Apply this patch 5) Run the search again 6) Note the items no longer appear in the search results Signed-off-by: Matthias Meusburger --- C4/Search.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 65ad919..bcbd692 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1534,8 +1534,13 @@ sub buildQuery { ## 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) ## In English: ## all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 - $availability_limit .= -"( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; + $availability_limit .= " + ( + ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') + and (lost,st-numeric=0) + and (damaged,st-numeric=0) + and (withdrawn,st-numeric=0) + )"; $limit_cgi .= "&limit=available"; $limit_desc .= ""; } -- 1.7.10.4