Bugzilla – Attachment 74002 Details for
Bug 20254
Forbid the download of duplicate EDI messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Block ingest of duplicate filenames
0001-Bug-20254-Do-not-ingest-files-with-duplicate-filenam.patch (text/plain), 1.22 KB, created by
Colin Campbell
on 2018-04-11 15:42:17 UTC
(
hide
)
Description:
Block ingest of duplicate filenames
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2018-04-11 15:42:17 UTC
Size:
1.22 KB
patch
obsolete
>From 6d9039a5ad6715e6015978398665f166387aeda4 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Wed, 24 Jan 2018 09:20:12 +0000 >Subject: [PATCH] Bug 20254 Do not ingest files with duplicate filenames > >If the supplier delivers the same file twice we are >unable to rename it on the second occurence causing us to download >and process it infinitely. > >This patch delays this to the ingest stage so that the >same code is processed irrespective of transport >--- > Koha/Edifact/Transport.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm >index caf2f5def3..e4eb976894 100644 >--- a/Koha/Edifact/Transport.pm >+++ b/Koha/Edifact/Transport.pm >@@ -183,6 +183,11 @@ sub sftp_download { > sub ingest { > my ( $self, $msg_hash, @downloaded_files ) = @_; > foreach my $f (@downloaded_files) { >+ my $existing_file = $self->{schema}->resultset('EdifactMessage')->find( { filename => $f, } ); >+ if ($existing_file) { >+ carp "skipping ingest of $f : filename exists"; >+ next; >+ } > $msg_hash->{filename} = $f; > my $file_content = > read_file( "$self->{working_dir}/$f", binmode => ':raw' ); >-- >2.14.3 >
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 20254
:
74002
|
83013
|
83014
|
83015
|
91412
|
91413
|
91414
|
92353
|
92354
|
92355