Bug 28293: (bug 20443 follow-up) Fix wrong key in Patrons::Import->generate_patron_attributes

It generates warnings
Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/Koha/Patrons/Import.pm line 550, <$fh> line 2.

And does not sort correctly (no fallback on the attribute's value for repeatable attributes)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-05-06 11:18:55 +02:00
parent 66d26fa301
commit 2da36e3f17
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ sub generate_patron_attributes {
my $ok = $csv->parse($string); # parse field again to get subfields!
my @list = $csv->fields();
my @patron_attributes =
sort { $a->{code} cmp $b->{code} || $a->{value} cmp $b->{value} }
sort { $a->{code} cmp $b->{code} || $a->{attribute} cmp $b->{attribute} }
map {
my @arr = split /:/, $_, 2;
{ code => $arr[0], attribute => $arr[1] }