From a45154e34a9c840f31c2fc2d5d264590c279c077 Mon Sep 17 00:00:00 2001 From: Andreas Jonsson Date: Wed, 13 Apr 2022 09:20:42 +0200 Subject: [PATCH] Bug 30520: Allow BatchImport to be used by command line tools. Signed-off-by: Martin Renvoize Signed-off-by: Marcel de Rooy Signed-off-by: Fridolin Somers --- C4/ImportBatch.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 47eeae5880..845caa3b58 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -679,12 +679,14 @@ sub BatchCommitRecords { } $oldxml = $old_marc->as_xml($marc_type); + my $context = { source => 'batchimport' }; + if ($logged_in_patron) { + $context->{categorycode} = $logged_in_patron->categorycode; + $context->{userid} = $logged_in_patron->userid; + } + ModBiblio($marc_record, $recordid, $oldbiblio->frameworkcode, { - overlay_context => { - source => 'batchimport', - categorycode => $logged_in_patron->categorycode, - userid => $logged_in_patron->userid - }, + overlay_context => $context }); $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?"; # FIXME call SetMatchedBiblionumber instead -- 2.39.5