From 31e0115caf24e0e14389ca614c030cc9c42bc5de Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Fri, 5 Aug 2011 12:48:01 -0400 Subject: [PATCH] Bug 6673: Create Batch Label from Staged MARC Records fails For some reason, the code attempts to get the current users branch in the following manner: $branch_code = get_branch_code_from_name($template->param('LoginBranchname')) This seems particularly cumbersome and prone to failure if there is not template param LoginBranchname. This patch changes the given line to use the more traditional method for finding current branchcode: $branch_code = C4::Context->userenv->{'branch'}; Initial testing shows this to help alleviate the problem Signed-off-by: Chris Cormack --- tools/manage-marc-import.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index 3c43dab..34d2639 100755 --- a/tools/manage-marc-import.pl +++ b/tools/manage-marc-import.pl @@ -189,7 +189,7 @@ sub redo_matching { sub create_labelbatch_from_importbatch { my ($batch_id) = @_; my $err = undef; - my $branch_code = get_branch_code_from_name($template->param('LoginBranchname')); + my $branch_code = C4::Context->userenv->{'branch'}; my $batch = C4::Labels::Batch->new(branch_code => $branch_code); my @items = GetItemNumbersFromImportBatch($batch_id); if (grep{$_ == 0} @items) { -- 1.7.4.1