@@ -, +, @@ --- cataloguing/value_builder/upload.pl | 8 ++++++-- .../en/modules/cataloguing/value_builder/upload.tt | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) --- a/cataloguing/value_builder/upload.pl +++ a/cataloguing/value_builder/upload.pl @@ -80,9 +80,9 @@ sub plugin { ); # Dealing with the uploaded file - if ($uploaded_file) { + my $dir = $input->param('dir'); + if ($uploaded_file and $dir) { my $fh = $input->upload('uploaded_file'); - my $dir = $input->param('dir'); $id = C4::UploadedFiles::UploadFile($uploaded_file, $dir, $fh->handle); if($id) { @@ -128,6 +128,10 @@ sub plugin { } else { $template->param( error_upload_path_not_configured => 1 ); } + + if ($uploaded_file and not $dir) { + $template->param(error_no_dir_selected => 1); + } } $template->param( --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt @@ -6,6 +6,20 @@ + @@ -59,6 +73,9 @@

Configuration variable 'upload_path' is not configured.

Please configure it in your koha-conf.xml

[% ELSE %] + [% IF (error_no_dir_selected) %] +

Error: You have to select the destination of uploaded file.

+ [% END %]

Please select the file to upload :

[% filefield %] --