Summary: | Item Types description not properly displayed if not pure ASCII | ||
---|---|---|---|
Product: | Koha | Reporter: | Frédéric Demians <f.demians> |
Component: | Architecture, internals, and plumbing | Assignee: | Frédéric Demians <f.demians> |
Status: | CLOSED FIXED | QA Contact: | Bugs List <koha-bugs> |
Severity: | normal | ||
Priority: | PATCH-Sent (DO NOT USE) | CC: | chris, paul.poulain |
Version: | 3.6 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Proposed patch
Proposed patch Proposed patch signed off patch Bug 6371 Item Types description not properly displayed if not pure ASCII |
Description
Frédéric Demians
2011-05-19 04:45:19 UTC
Created attachment 4177 [details] [review] Proposed patch Created attachment 4178 [details] [review] Proposed patch Created attachment 4179 [details] [review] Proposed patch Created attachment 4214 [details] [review] signed off patch The problem exists, and the patch works, but i have a question about it. Let me explain: itemtypes are also accessed through C4/Koha.pm, sub GetItemTypes that is sub GetItemTypes { # returns a reference to a hash of references to itemtypes... my %itemtypes; my $dbh = C4::Context->dbh; my $query = qq| SELECT * FROM itemtypes |; my $sth = $dbh->prepare($query); $sth->execute; while ( my $IT = $sth->fetchrow_hashref ) { $itemtypes{ $IT->{'itemtype'} } = $IT; } return ( \%itemtypes ); } As a reminder, the sub in C4/ItemTypes.pm is : sub all { my ($class) = @_; my $dbh = C4::Context->dbh; return map { $class->new($_) } @{$dbh->selectall_arrayref( # The itemtypes table is small enough for # `SELECT *` to be harmless. "SELECT * FROM itemtypes ORDER BY description", { Slice => {} }, )}; } I don't see any "utf8::encode" in the GetItemTypes, the sub is quite similar, except one uses selectall_arrayref, the other fetchrow_hashref. Why the hell is it needed to utf8::encode the ItemTypes.pm and not the GetItemTypes ? What I fear is that the utf8::encode solves this problem, but another problem will happen later. If anyone has an idea... This bug is still here in Koha 3.4.4. The patch still apply and should be included in HEAD en 3.4 branches. Created attachment 5772 [details] [review] Bug 6371 Item Types description not properly displayed if not pure ASCII In several places, C4::ItemType module is used to retrieve item types and their description. If the description text contains non-ASCII characters, those characters are not properly displayed. This bug can be seen in: - 4xx plugin of a UNIMARC DB - Home > Admin > Item circulation alerts - others?... Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> - Fixes display probems in circulation alerts and 4xx UNIMARC plugin - display in other places looks ok with and without patch Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> QA comment * good test plan * small patch * no code comment to do, it's only a few lines long * works as expected => passed QA Pushed please test > Pushed please test
It works now in HEAD.
|