From 8d9c16683bf71f4ab04c22ecbb808eff7dd6801c Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sat, 4 Aug 2012 11:04:17 -0400 Subject: [PATCH] Silence warnings in search results for holdable copies Have not yet determined the exact reason the holdable copies size is not defined in some instances in the search results only, but this commit prevents warnings from being spewed by apache about undefined variables. Signed-off-by: Dan Scott --- Open-ILS/src/templates/opac/parts/result/table.tt2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2 index 225c21a17a..bc52adb1ed 100644 --- a/Open-ILS/src/templates/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/table.tt2 @@ -217,8 +217,9 @@
[%- search_ou = ctx.search_ou; + num_holdable_copies = attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size || 0; IF ctx.place_unfillable || - ( attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0 + ( num_holdable_copies > 0 && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0) ) %] -- 2.11.0