Bugzilla – Attachment 61434 Details for
Bug 18312
Export is broken unless a file is supplied
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18312: Fix export unless a file is supplied
Bug-18312-Fix-export-unless-a-file-is-supplied.patch (text/plain), 1.67 KB, created by
Jesse Maseto
on 2017-03-22 09:36:13 UTC
(
hide
)
Description:
Bug 18312: Fix export unless a file is supplied
Filename:
MIME Type:
Creator:
Jesse Maseto
Created:
2017-03-22 09:36:13 UTC
Size:
1.67 KB
patch
obsolete
>From cfabab15d0a46a0eff9440a205de263a7e7ea05d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Mar 2017 10:52:42 -0300 >Subject: [PATCH] Bug 18312: Fix export unless a file is supplied > >Bug 18087 breaks export unless a file is supplied. > >Can't use an undefined value as a HASH reference at >/home/vagrant/kohaclone/tools/export.pl line 75. > >Test plan: >Export records using a file of id that is not a valid file (not txt or >csv) >Export records using a valid file >Export records without supplying a file > >=> The export should work or fail as expected. > >Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> >--- > tools/export.pl | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/tools/export.pl b/tools/export.pl >index ecf4a04..1f1eebe 100755 >--- a/tools/export.pl >+++ b/tools/export.pl >@@ -72,11 +72,13 @@ my @branch = $query->multi_param("branch"); > my @messages; > if ( $op eq 'export' ) { > my $filename = $query->param('id_list_file'); >- my $mimetype = $query->uploadInfo($filename)->{'Content-Type'}; >- my @valid_mimetypes = qw( application/octet-stream text/csv text/plain ); >- unless ( grep { /^$mimetype$/ } @valid_mimetypes ) { >- push @messages, { type => 'alert', code => 'invalid_mimetype' }; >- $op = ''; >+ if ( $filename ) { >+ my $mimetype = $query->uploadInfo($filename)->{'Content-Type'}; >+ my @valid_mimetypes = qw( application/octet-stream text/csv text/plain ); >+ unless ( grep { /^$mimetype$/ } @valid_mimetypes ) { >+ push @messages, { type => 'alert', code => 'invalid_mimetype' }; >+ $op = ''; >+ } > } > } > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18312
:
61391
|
61434
|
61609