From 70007ca4cb1740049021eaa9301344c3680100ad Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sun, 16 Dec 2012 09:09:03 -0500 Subject: [PATCH] TPAC: Fallback default value for facet.default_display_count Open-ILS/templates/opac/parts/result/facets.tt2 assigns the value of facet.default_display_count to DEFAULT_DISPLAY_COUNT and then uses the latter in a number of comparisons. facet.default_display_count is expected to be defined in config.tt2; however, on upgrade, sites with many override templates may not realize that they need to define that value in config.tt2. If they do not, then the result is a strange facet display where only the facet category header shows, with no facets, and Apache error log messages like: Argument "" isn't numeric in numeric gt (>) at /openils/var/templates/opac/parts/result/facets.tt2 line 72. This simple defensive fix assigns a fallback default value if one was not provided in config.tt2 Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- Open-ILS/src/templates/opac/parts/result/facets.tt2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/opac/parts/result/facets.tt2 b/Open-ILS/src/templates/opac/parts/result/facets.tt2 index fed133ab8d..c5b95a0790 100644 --- a/Open-ILS/src/templates/opac/parts/result/facets.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/facets.tt2 @@ -8,7 +8,8 @@ selected_facets = CGI.param('facet') || []; sorted_facets = []; # we'll clobber the facet. "namespace" later -DEFAULT_DISPLAY_COUNT = facet.default_display_count; +# Provide a default value if unset in config.tt2 +DEFAULT_DISPLAY_COUNT = facet.default_display_count || 5; IF facet.display; -- 2.43.2