From e9677582b32ceca19d785a32ac494e52ab66bd26 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 Signed-off-by: Martin Renvoize Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize (cherry picked from commit 0eb9edbf229bdbde02ff65e5f955fb18cf0cc7db) Signed-off-by: Fridolin Somers --- 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.39.5