From: Ben Shum Date: Wed, 21 Nov 2012 19:17:59 +0000 (-0500) Subject: KPAC - fix getit_results with short titles X-Git-Tag: sprint4-merge-nov22~3654 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8bf4143b9c0fcd2d6948c1b172e5e4b1acd167a3;p=working%2FEvergreen.git 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 --- 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); %]