Bug 12638

Summary: UTF-8 support; C4::Members::AttributeTypes::GetAttributeTypes_hashref should be rewrite
Product: Koha Reporter: Zeno Tajoli <ztajoli>
Component: Architecture, internals, and plumbingAssignee: Galen Charlton <gmcharlt>
Status: RESOLVED LATER QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: jonathan.druart, katrin.fischer
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12650
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20445
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20443
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Zeno Tajoli 2014-07-23 14:40:11 UTC
If I create a new authorised values list, I use it in Patron attribute types and in the Patron attribute type code I insert something like 'λλλ', those special chars create problems to C4::Members::AttributeTypes::GetAttributeTypes_hashref.

You can see the problem settinf an new authorised values list, use it in a new 
Patron attribute type and as code in Patron attribute type code use 'λλλ'.

Then go to Tool -> Patron lists and create a list
After go to Tool -> Batch patron modification and try to use the list that you have create to configure a change in patron.

This errot it will block you:

Software error:

Can't call method "authorised_value_category" on an undefined value at /home/koha/src/tools/modborrowers.pl line 109.
Comment 1 Jonathan Druart 2014-07-23 15:04:06 UTC
Should be fixed by bug 11944 comment 208.
Comment 2 Jonathan Druart 2014-07-24 08:43:15 UTC
(In reply to Jonathan Druart from comment #1)
> Should be fixed by bug 11944 comment 208.

No, it is not fixed.

But it seems to come from the Perl version.
The sandboxes are using Perl v5.10, and I use Perl v.5.18.
The issue occurs on sandboxes using the master branch.

So I consider it is not introduced by bug 11944 and should not be blocker.
Comment 3 Jonathan Druart 2014-07-24 14:16:21 UTC
Given the following script:

test.pl
#!/usr/bin/perl
use Modern::Perl;
use Data::Dumper;
my $h = {id=>'λλλ', description=>'λλλ'};
warn Dumper $h;

1/ With perl v.5.10

a) perl test.pl
$VAR1 = { 
          'description' => 'λλλ',
          'id' => 'λλλ'
        };

b) cgi-bin/koha/test.pl displays in the Koha logs:
$VAR1 = {
          'id' => '\xce\xbb\xce\xbb\xce\xbb',
          'description' => '\xce\xbb\xce\xbb\xce\xbb'
};

2/ With perl v.5.18

a) perl test.pl
$VAR1 = { 
          'description' => 'λλλ',
          'id' => 'λλλ'
        };

b) cgi-bin/koha/test.pl displays in the Koha logs:
$VAR1 = { 
          'description' => 'λλλ',
          'id' => 'λλλ'
        };
Comment 4 Jonathan Druart 2014-07-24 14:17:08 UTC
(In reply to Jonathan Druart from comment #3)

I didn't test on the same machine, so it could be something else.
Comment 5 Katrin Fischer 2020-01-06 00:01:22 UTC
Is this still an issue now (5 and something years later) or could it be closed?
Comment 6 Jonathan Druart 2020-01-06 21:30:19 UTC
(In reply to Katrin Fischer from comment #5)
> Is this still an issue now (5 and something years later) or could it be
> closed?

Still an issue for old version of Perl I'd say.

Will be fixed by bug 20443.