Leading spaces in a search term were causing an error to be thrown in a join 
operator when auto-truncations is turned on. This patch removes the leading 
spaces.
---
 C4/Search.pm |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/C4/Search.pm b/C4/Search.pm
index 2fe57ed..e8903fc 100644
--- a/C4/Search.pm
+++ b/C4/Search.pm
@@ -932,8 +932,10 @@ sub buildQuery {
                 }
 
                 if ($auto_truncation){
-                                       $operand=~join(" ",map{ "$_*" }split 
(/\s+/,$operand));
-                               }
+                   # join throws an error if there is a leading space
+                   $operand =~ s/^\s+//;
+                  $operand=~join(" ",map{ "$_*" }split (/\s+/,$operand));
+                }
 
                 # Detect Truncation
                 my $truncated_operand;
-- 
1.6.0.4

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to