Bug 23933: (bug 10132 follow-up) Fix commit_file.pl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-11-04 12:25:33 +01:00 committed by Martin Renvoize
parent b687c60b27
commit 0eb9edbf22
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 1 deletions

View File

@ -575,7 +575,8 @@ sub AddAuthority {
my $marcorgcode = C4::Context->preference('MARCOrgCode');
if ( $userenv && $userenv->{'branch'} ) {
$library = Koha::Libraries->find( $userenv->{'branch'} );
$marcorgcode = $library->get_effective_marcorgcode;
# userenv's library could not exist because of a trick in misc/commit_file.pl (see FIXME and set_userenv statement)
$marcorgcode = $library ? $library->get_effective_marcorgcode : $marcorgcode;
}
if (!$record->leader) {
$record->leader($leader);