From: Marcel de Rooy Date: Fri, 24 Jan 2020 11:17:15 +0000 (+0000) Subject: Bug 24305: (QA follow-up) Strip table name in [[table.field|alias]] X-Git-Tag: v20.05.00~1841 X-Git-Url: http://git.equinoxoli.org/?p=koha.git;a=commitdiff_plain;h=dc419ab2a9e7f3c49934272161597d903c24ea95 Bug 24305: (QA follow-up) Strip table name in [[table.field|alias]] When you would use the construct, you wont have batch features unless we strip the table name. This is consistent with the $sth->{NAME} used to fill the headers by default. Test plan: Use [[items.biblionumber|bibno]] instead of items.biblionumber in a reporting query. Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 5059e95..fa2817f 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -1091,6 +1091,7 @@ sub get_prepped_report { for(my $i=0;$i<$#split/2;$i++){ #The placeholders are always the odd elements of the array my ($type,$name) = split /\|/,$split[$i*2+1]; # We split them on '|' $headers->{$name} = $type; # Store as a lookup for the template + $headers->{$name} =~ s/^\w*\.//; # strip the table name just as in $sth->{NAME} array $split[$i*2+1] =~ s/(\||\?|\.|\*|\(|\)|\%)/\\$1/g; #Quote any special characters so we can replace the placeholders $name = C4::Context->dbh->quote($name); $sql =~ s/\[\[$split[$i*2+1]\]\]/$type AS $name/; # Remove placeholders from SQL