From b062847364d82873c8a54aac544c9109102b3625 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 31 Oct 2013 22:36:39 +0000 Subject: [PATCH] Bug 8015: (follow-up) don't require userenv Core routines probably should never assume that they're running with a valid userenv defined. Signed-off-by: Galen Charlton --- C4/MarcModificationTemplates.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm index f504621908..50b77df740 100644 --- a/C4/MarcModificationTemplates.pm +++ b/C4/MarcModificationTemplates.pm @@ -495,7 +495,8 @@ sub ModifyRecordWithTemplate { warn( "Unmodified Record:\n" . $record->as_formatted() ) if DEBUG >= 10; my $current_date = DateTime->now()->ymd(); - my $branchcode = C4::Context->userenv->{branch}; + my $branchcode = ''; + $branchcode = C4::Context->userenv->{branch} if C4::Context->userenv; my @actions = GetModificationTemplateActions( $template_id ); -- 2.39.5