From 4f63ac9dff283ce5d3a81d99dacbc0ed06fc2352 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 9 Feb 2024 08:36:59 +0000 Subject: [PATCH] Bug 34478: Changes for tools/upload-images First upload form does not submit (ajax processing). Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/en/modules/tools/upload-images.tt | 4 ++-- tools/upload-cover-image.pl | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt index 7b4fe321bc..3942d60f19 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt @@ -183,8 +183,7 @@
[% END %] -
- [% INCLUDE 'csrf-token.inc' %] +
@@ -209,6 +208,7 @@ [% INCLUDE 'csrf-token.inc' %] + [% IF itemnumber %] diff --git a/tools/upload-cover-image.pl b/tools/upload-cover-image.pl index 594096d493..28db64a4da 100755 --- a/tools/upload-cover-image.pl +++ b/tools/upload-cover-image.pl @@ -67,10 +67,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $filetype = $input->param('filetype'); my $biblionumber = $input->param('biblionumber'); my $itemnumber = $input->param('itemnumber'); -#my $uploadfilename = $input->param('uploadfile'); # obsolete? -my $replace = !C4::Context->preference("AllowMultipleCovers") - || $input->param('replace'); -my $op = $input->param('op'); +my $replace = !C4::Context->preference("AllowMultipleCovers") + || $input->param('replace'); +my $op = $input->param('op') // q{}; my $error; @@ -99,7 +98,7 @@ $template->param( my $total = 0; my @results; -if ($fileID) { +if ( $op eq 'cud-process' & $fileID ) { my $upload = Koha::UploadedFiles->find( $fileID ); if ( $filetype eq 'image' ) { my $fh = $upload->file_handle; -- 2.39.5