[Koha-bugs] [Bug 6371] Item Types description not properly displayed if not pure ASCII

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Aug 11 11:26:55 CEST 2011


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6371

Paul Poulain <paul.poulain at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paul.poulain at biblibre.com

--- Comment #5 from Paul Poulain <paul.poulain at biblibre.com> 2011-08-11 09:26:55 UTC ---
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...

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the Koha-bugs mailing list