Bugzilla – Attachment 17680 Details for
Bug 10110
Problems with diacritics in saved SQL reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10010: Problems with diacritics in saved SQL reports
Bug-10010-Problems-with-diacritics-in-saved-SQL-re.patch (text/plain), 2.03 KB, created by
Marcel de Rooy
on 2013-04-25 12:42:30 UTC
(
hide
)
Description:
Bug 10010: Problems with diacritics in saved SQL reports
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-04-25 12:42:30 UTC
Size:
2.03 KB
patch
obsolete
>From eef58bd8a230e10ebac4fbeb70686533d3a0c4ca Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 25 Apr 2013 13:54:31 +0200 >Subject: [PATCH] Bug 10010: Problems with diacritics in saved SQL reports >Content-Type: text/plain; charset=utf-8 > >Adds decoding for cgi params (for completeness). >Apparently, the NAME attribute of DBI statement handle has a UTF8 bug. >Fixing this by decoding the returned column names. >Did this in a shared routine. >--- > reports/guided_reports.pl | 15 ++++++++++----- > 1 files changed, 10 insertions(+), 5 deletions(-) > >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index c25767a..0c940d2 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -18,7 +18,7 @@ > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > > >-use CGI; >+use CGI qw/-utf8/; > use Text::CSV; > use URI::Escape; > use C4::Reports::Guided; >@@ -653,9 +653,8 @@ elsif ($phase eq 'Run this report'){ > unless ($sth) { > die "execute_query failed to return sth for report $report_id: $sql"; > } else { >- my $headref = $sth->{NAME} || []; >- my @headers = map { +{ cell => $_ } } @$headref; >- $template->param(header_row => \@headers); >+ my $headers= header_cell_loop($sth); >+ $template->param(header_row => $headers); > while (my $row = $sth->fetchrow_arrayref()) { > my @cells = map { +{ cell => $_ } } @$row; > push @rows, { cells => \@cells }; >@@ -772,7 +771,13 @@ elsif ($phase eq 'Save Compound'){ > # pass $sth, get back an array of names for the column headers > sub header_cell_values { > my $sth = shift or return (); >- return @{$sth->{NAME}}; >+ my @cols; >+ foreach my $c (@{$sth->{NAME}}) { >+ #FIXME apparently DBI still needs a utf8 fix for this? >+ utf8::decode($c); >+ push @cols, $c; >+ } >+ return @cols; > } > > # pass $sth, get back a TMPL_LOOP-able set of names for the column headers >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10110
:
17680
|
17682
|
17683
|
17704
|
17705
|
17743
|
17744
|
17745