Bugzilla – Attachment 129597 Details for
Bug 29156
File missing warning in Koha::UploadedFile should be for permanent files only
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only
Bug-29156-File-missing-warning-in-KohaUploadedFile.patch (text/plain), 1.62 KB, created by
Martin Renvoize (ashimema)
on 2022-01-19 10:49:27 UTC
(
hide
)
Description:
Bug 29156: File missing warning in Koha::UploadedFile for permanent files only
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-01-19 10:49:27 UTC
Size:
1.62 KB
patch
obsolete
>From 1697c832f49fa6ef7c2a02ef2331d042ce05cb9b Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 1 Oct 2021 13:06:57 -1000 >Subject: [PATCH] Bug 29156: File missing warning in Koha::UploadedFile for > permanent files only > >When an uploaded file is deleted, when file does not exist there is a warning : >"Removing record for file.txt within category koha_upload, but file was missing." > >For temporary files, this warning is noisy. >For example when they are in /tmp, system reboot deleted them. > >I propose to remove this warning for temporary files. > >Test plan : >1) Upload a temporary and a permanent file via Tools > Upload >2) Delete the file on server >3) Delete the two files from Tools > Upload >4) Look at warning in log files >=> You see only warning for permanent file > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/UploadedFile.pm | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/Koha/UploadedFile.pm b/Koha/UploadedFile.pm >index 009c333a8d..13ec2eaadb 100644 >--- a/Koha/UploadedFile.pm >+++ b/Koha/UploadedFile.pm >@@ -78,8 +78,10 @@ sub delete { > return $retval if $params->{keep_file}; > > if( ! -e $file ) { >- warn "Removing record for $name within category ". >- $self->uploadcategorycode. ", but file was missing."; >+ if ( $self->permanent ) { >+ warn "Removing record for $name within category ". >+ $self->uploadcategorycode. ", but file was missing."; >+ } > } elsif( ! unlink($file) ) { > warn "Problem while deleting: $file"; > } >-- >2.20.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 29156
:
125645
|
128101
| 129597