Skip to content

Commit

Permalink
Merge branch 'add-array-format-xattr' into 22.11-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudGLT committed Oct 3, 2023
2 parents adbfaab + 0b0ab69 commit 7037128
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Koha/Plugin/Com/Biblibre/PatronImport/Helper/Mapping.pm
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ sub map_patron_object {
if ( exists $borrowers_fields->{ $key } ) {
$patron->{ $key } = $borrower->{ $key };
} else {
push @{ $patron->{xattr} }, { code => $key, attribute => $borrower->{ $key } };
if(ref($borrower->{$key}) ne 'ARRAY') {
$borrower->{$key} = [$borrower->{$key}];
}
push @{ $patron->{xattr} }, { code => $key, attribute => $_ } for @{$borrower->{$key}};
}
}
}
Expand Down

0 comments on commit 7037128

Please sign in to comment.