Bugzilla – Attachment 39653 Details for
Bug 14295
Add creation time, size and owner for uploaded files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14295: Add creation time, size and owner for uploaded files
Bug-14295-Add-creation-time-size-and-owner-for-upl.patch (text/plain), 1.31 KB, created by
Marcel de Rooy
on 2015-05-29 07:02:37 UTC
(
hide
)
Description:
Bug 14295: Add creation time, size and owner for uploaded files
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-05-29 07:02:37 UTC
Size:
1.31 KB
patch
obsolete
>From f52512d1be68f881e5d19809f3f07aa5e28f40be Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 29 May 2015 08:57:31 +0200 >Subject: [PATCH] Bug 14295: Add creation time, size and owner for uploaded > files >Content-Type: text/plain; charset=utf-8 > >When inserting a new record in uploaded_files, we want to fill the new >columns correctly. > >Test plan: >Upload a file via the upload plugin. Verify that filesize, owner and >creation time are correct in the database record. >Run the unit test UploadedFiles.t. >--- > C4/UploadedFiles.pm | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/C4/UploadedFiles.pm b/C4/UploadedFiles.pm >index bf040bd..d8a5be4 100644 >--- a/C4/UploadedFiles.pm >+++ b/C4/UploadedFiles.pm >@@ -175,11 +175,14 @@ sub UploadFile { > > my $dbh = C4::Context->dbh; > my $query = qq{ >- INSERT INTO uploaded_files (id, filename, dir) >- VALUES (?,?, ?); >+ INSERT INTO uploaded_files >+ (id, filename, dir, filesize, owner) >+ VALUES (?,?, ?, ?, ?); > }; > my $sth = $dbh->prepare($query); >- if($sth->execute($id, $filename, $dir)) { >+ my $ue = C4::Context->userenv; >+ my $owner = $ue? $ue->{number}: undef; >+ if( $sth->execute($id, $filename, $dir, length($data), $owner ) ) { > return $id; > } > >-- >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 14295
:
39652
| 39653