From 17ec52961ca38346ed4cfe3d7e97627c59661051 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 9 Feb 2024 09:02:57 +0000 Subject: [PATCH] Bug 34478: Changes for tools/stage-marc-import First form is ajax upload, no post needed. Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt | 4 ++-- tools/stage-marc-import.pl | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt index 98910230c9..072ce87ff8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt @@ -88,8 +88,7 @@
  • Select a MARC file to stage in the import reservoir. It will be parsed, and each valid record staged for later import into the catalog.
  • You can enter a name for this import. It may be useful, when creating a record, to remember where the suggested MARC data comes from!
  • -
    - [% INCLUDE 'csrf-token.inc' %] +
    Upload a file to stage
      @@ -131,6 +130,7 @@ [% INCLUDE 'csrf-token.inc' %] + [% IF basketno && booksellerid %] diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl index e60ed7c5a6..736a5223db 100755 --- a/tools/stage-marc-import.pl +++ b/tools/stage-marc-import.pl @@ -44,6 +44,7 @@ use Koha::ImportBatches; use Koha::BackgroundJob::StageMARCForImport; my $input = CGI->new; +my $op = $input->param('op') // q{}; my $fileID = $input->param('uploadedfileid'); my $matcher_id = $input->param('matcher'); @@ -75,7 +76,7 @@ $template->param( booksellerid => $booksellerid, ); -if ($fileID) { +if ( $op eq 'cud-stage' && $fileID ) { my $upload = Koha::UploadedFiles->find( $fileID ); my $filepath = $upload->full_path; my $filename = $upload->filename; -- 2.39.5