Bugzilla – Attachment 42665 Details for
Bug 14321
Merge UploadedFile and UploadedFiles into Koha::Upload
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14321: [QA Follow-up] Changes for Upload.pm and upload-file.pl
Bug-14321-QA-Follow-up-Changes-for-Uploadpm-and-up.patch (text/plain), 2.53 KB, created by
Julian Maurice
on 2015-09-17 13:08:35 UTC
(
hide
)
Description:
Bug 14321: [QA Follow-up] Changes for Upload.pm and upload-file.pl
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2015-09-17 13:08:35 UTC
Size:
2.53 KB
patch
obsolete
>From b8494c8b5d14698bd7b5f426dcbd83a4714f8b04 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 16 Sep 2015 13:53:38 +0200 >Subject: [PATCH] Bug 14321: [QA Follow-up] Changes for Upload.pm and > upload-file.pl > >Based on QA comments, this patch does the following: >[1] Destroy an empty DESTROY. >[2] Promote some comment lines to POD. >[3] Use File::Spec->catfile in sub _full_fname. >[4] Remove variable interpolation from a sql query. >[5] Add a comment in upload-file.pl. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Run the unit test again, and uploaded a file. > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > Koha/Upload.pm | 19 ++++++++++--------- > tools/upload-file.pl | 3 ++- > 2 files changed, 12 insertions(+), 10 deletions(-) > >diff --git a/Koha/Upload.pm b/Koha/Upload.pm >index 9b580ec..e8787fa 100644 >--- a/Koha/Upload.pm >+++ b/Koha/Upload.pm >@@ -211,10 +211,7 @@ sub delete { > return @res; > } > >-sub DESTROY { >-} >- >-# ************** HELPER ROUTINES / CLASS METHODS ****************************** >+=head1 CLASS METHODS > > =head2 getCategories > >@@ -243,7 +240,9 @@ sub httpheaders { > ); > } > >-# ************** INTERNAL ROUTINES ******************************************** >+=head1 INTERNAL ROUTINES >+ >+=cut > > sub _init { > my ( $self, $params ) = @_; >@@ -310,9 +309,11 @@ sub _full_fname { > my ( $self, $rec ) = @_; > my $p; > if( ref $rec ) { >- $p= $rec->{permanent}? $self->{rootdir}: $self->{tmpdir}; >- $p.= '/'; >- $p.= $rec->{dir}. '/'. $rec->{hashvalue}. '_'. $rec->{filename}; >+ $p = File::Spec->catfile( >+ $rec->{permanent}? $self->{rootdir}: $self->{tmpdir}, >+ $rec->{dir}, >+ $rec->{hashvalue}. '_'. $rec->{filename} >+ ); > } > return $p; > } >@@ -359,7 +360,7 @@ sub _register { > sub _lookup { > my ( $self, $params ) = @_; > my $dbh = C4::Context->dbh; >- my $sql = qq| >+ my $sql = q| > SELECT id,hashvalue,filename,dir,filesize,categorycode,public,permanent > FROM uploaded_files > |; >diff --git a/tools/upload-file.pl b/tools/upload-file.pl >index f54d6b1..1994214 100755 >--- a/tools/upload-file.pl >+++ b/tools/upload-file.pl >@@ -81,7 +81,8 @@ sub send_reply { # response will be sent back as JSON > }); > } > >-sub upload_pars { >+sub upload_pars { # this sub parses QUERY_STRING in order to build the >+ # parameter hash for Koha::Upload > my ( $qstr ) = @_; > $qstr = Encode::decode_utf8( uri_unescape( $qstr ) ); > # category could include a utf8 character >-- >1.9.1
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 14321
:
41498
|
41499
|
41500
|
41501
|
41555
|
41556
|
41557
|
41558
|
41559
|
41560
|
41561
|
41562
|
41665
|
41666
|
41667
|
41668
|
41669
|
41677
|
41873
|
41874
|
41875
|
41876
|
41877
|
41878
|
41879
|
41880
|
41881
|
42411
|
42412
|
42413
|
42414
|
42558
|
42559
|
42560
|
42561
|
42584
|
42587
|
42588
|
42589
|
42590
|
42591
|
42660
|
42661
|
42662
|
42663
|
42664
|
42665
|
42666
|
42707
|
42726
|
42727
|
42728
|
42729
|
42730
|
42731
|
42732
|
42889
|
42890