From 8bf4143b9c0fcd2d6948c1b172e5e4b1acd167a3 Mon Sep 17 00:00:00 2001 From: Ben Shum Date: Wed, 21 Nov 2012 14:17:59 -0500 Subject: [PATCH] KPAC - fix getit_results with short titles When using the "Get it" options to either add an item to a list or place an item on hold, one would get an internal server error whenever attemping this on a bib record with a short title. Turns out that the substr function that shortens the length of long titles breaks when the title is 18 characters or less. Add an IF check around the substr function to avoid this error. Signed-off-by: Ben Shum Signed-off-by: Michael Peters --- Open-ILS/src/templates/kpac/getit_results.tt2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/kpac/getit_results.tt2 b/Open-ILS/src/templates/kpac/getit_results.tt2 index bdcfd7f60f..ace6ce5bfb 100644 --- a/Open-ILS/src/templates/kpac/getit_results.tt2 +++ b/Open-ILS/src/templates/kpac/getit_results.tt2 @@ -55,7 +55,7 @@ [% title = attrs.title || ''; - title = title.substr(18, title.length, '...'); + IF title.length > 18; title = title.substr(18, title.length, '...'); END; l('Back to [_1]', title); %] -- 2.11.0