From 8796695956b5e2d0ccf91d0fa7ea94413f78221e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 4 Nov 2019 12:25:33 +0100 Subject: [PATCH] Bug 23933: (bug 10132 follow-up) Fix commit_file.pl Content-Type: text/plain; charset=utf-8 Signed-off-by: Martin Renvoize Signed-off-by: Marcel de Rooy --- C4/AuthoritiesMarc.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 0d90b37d67..c0c42df2bd 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -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); -- 2.11.0