Bug 6989 Patron categories not properly displayed if not pure ASCII
C4::Category module returns badly encoded patron categories when they are
containing non pure-ASCII characters.
To reproduce this bug:
- Go in Administration > Patron Categories
- Add a new category. Give it this code for example:
Café
- Click on Patrons link on top menu
- Click on New button
=> You get 'Café' displayed without accent
Signed-off-by: Piotr Wejman <ropuch@bagno.be>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit d998166ea3)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
parent
da2dfd0dce
commit
0ec00cd1cb
|
|
@ -71,13 +71,12 @@ C<description>.
|
|||
=cut
|
||||
|
||||
sub all {
|
||||
my ($class) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
return map { $class->new($_) } @{$dbh->selectall_arrayref(
|
||||
# The categories table is small enough for
|
||||
# `SELECT *` to be harmless.
|
||||
"SELECT * FROM categories ORDER BY description",
|
||||
{ Slice => {} },
|
||||
my $class = shift;
|
||||
map {
|
||||
utf8::encode($_->{description});
|
||||
$class->new($_);
|
||||
} @{C4::Context->dbh->selectall_arrayref(
|
||||
"SELECT * FROM categories ORDER BY description", { Slice => {} }
|
||||
)};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue