From e01c4aa27903559980015059c8da4e0c481fbbd3 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 --- C4/Search.pm | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index ce6129d..aeeca97 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1476,8 +1476,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.2.5