From a3e59f3bf24d8ff5185608a3c16386250783a589 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Wed, 30 Mar 2011 21:49:37 +1300 Subject: [PATCH] Bug 5917 : FIxing problem with comma in variable names --- catalogue/search.pl | 5 ++++- installer/html-template-to-template-toolkit.pl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index b1a0b4fe1d..8113bd3e60 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -384,7 +384,10 @@ my @indexes; # if a simple index (only one) display the index used in the top search box if ($indexes[0] && (!$indexes[1] || $params->{'scan'})) { - $template->param("ms_".$indexes[0] => 1);} + my $idx = "ms_".$indexes[0]; + $idx =~ s/\,/comma/g; # template toolkit doesnt like variables with a , in it + $template->param($idx => 1); +} # an operand can be a single term, a phrase, or a complete ccl query diff --git a/installer/html-template-to-template-toolkit.pl b/installer/html-template-to-template-toolkit.pl index ce65e97d3d..fc69ee31c0 100755 --- a/installer/html-template-to-template-toolkit.pl +++ b/installer/html-template-to-template-toolkit.pl @@ -88,7 +88,7 @@ foreach my $file (@template_files) { $input_tmpl =~ s/"(\w+)\+"/"$1plus"/ig; $input_tmpl =~ s/"(\w+)\-"/"$1minus"/ig; $input_tmpl =~ s/"(\w+)!"/"$1exclamation"/ig; -# $input_tmpl =~ s/"(\w+),(\w+)"/"$1comma$2"/ig; #caused a problem in patron search + $input_tmpl =~ s/"(\w+),(\w+)"/"$1comma$2"/ig; #caused a problem in patron search $input_tmpl =~ s/NAME="mod"/NAME="modname"/ig; # handle 'naked' TMPL_VAR "parameter" by turning them into what they should be, TMPL_VAR NAME="parameter" $input_tmpl =~ s/TMPL_VAR\s+"(\w+)"/TMPL_VAR NAME="$1"/ig; -- 2.39.5