From 2c73648f77e530fdd50885bd0e72343d0d4c5c4e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 5 Jul 2023 15:44:50 +0200 Subject: [PATCH] Bug 27824: Trim column headers To support additional spaces. Using the system for defining a column name placeholder (Bug 23390), if there is a space inside the column name placeholder it won't work. The SQL example in Bug 5697: SELECT i.itemnumber, i.itemnumber as Exemplarnummber, [[i.itemnumber| itemnumber for batch]], CONCAT('', i.itemnumber, '' ) AS "itemnumber as edit link" FROM items i "[[i.itemnumber| itemnumber for batch]]" has a space before "itemnumber for batch." With that space removed it works as expected. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- Koha/Report.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Report.pm b/Koha/Report.pm index 937f10e917..55daece836 100644 --- a/Koha/Report.pm +++ b/Koha/Report.pm @@ -140,6 +140,7 @@ sub prep_report { { #The placeholders are always the odd elements of the array my ( $type, $name ) = split /\|/, $split[ $i * 2 + 1 ]; # We split them on '|' + $name =~ s/^\s+|\s+$//; # Trim $headers->{$name} = $type; # Store as a lookup for the template $headers->{$name} =~ s/^\w*\.//; # strip the table name just as in $sth->{NAME} array -- 2.39.5