From 28e286fded659bc2c31ece4a7491637d9dfd618f 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 Content-Type: text/plain; charset=utf-8 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 Signed-off-by: Marcel de Rooy --- C4/Search.pm | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 1b5c6fa..a680d3e 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1514,8 +1514,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.7.6