Bugzilla – Attachment 61609 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.76 KB, created by
Marcel de Rooy
on 2017-03-24 12:48:31 UTC
(
hide
)
Description:
Bug 18312: Fix export unless a file is supplied
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-03-24 12:48:31 UTC
Size:
1.76 KB
patch
obsolete
>From 1741b8480e9b67f08584097aabf080ee4651c4d8 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 >Content-Type: text/plain; charset=utf-8 > >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> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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 = ''; >+ } > } > } > >-- >2.1.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