From 1b8c903f7e197d6f6314eec4654319f6d345f229 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. --- Koha/Report.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Report.pm b/Koha/Report.pm index 937f10e9172..55daece8362 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.25.1