Bugzilla – Attachment 182463 Details for
Bug 39904
EDIFACT error messages are malformed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39904: EDIFACT error messages are malformed
Bug-39904-EDIFACT-error-messages-are-malformed.patch (text/plain), 3.16 KB, created by
David Nind
on 2025-05-14 17:55:57 UTC
(
hide
)
Description:
Bug 39904: EDIFACT error messages are malformed
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-05-14 17:55:57 UTC
Size:
3.16 KB
patch
obsolete
>From 1c85bf9d6352ba52705ed58a5c7eac79d9c9737c Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 14 May 2025 14:52:07 +0000 >Subject: [PATCH] Bug 39904: EDIFACT error messages are malformed > >Perl can interpolate hashrefs but not method calls. This results in messages like "Cannot connect to Koha::Schema::Result::VendorEdiAccount=HASH(0xaaab059252f0)->host: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58." when running the edi_cron.pl cronjob. > >Test Plan: >1) Enable EDIFACT >2) Create a fake EDI account with a bad FTP server in it >3) Run edi_cron.pl >4) Note the errors like: > Cannot connect to Koha::Schema::Result::VendorEdiAccount=HASH(0xaaab059252f0)->host: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58. >5) Apply this patch >6) Run edi_cron.pl >7) Note the errors are now like: > Cannot connect to test.example.com: Name or service not known: My Test at ./misc/cronjobs/edi_cron.pl line 58. > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Edifact/Transport.pm | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm >index a26f2842ff..72979924ba 100644 >--- a/Koha/Edifact/Transport.pm >+++ b/Koha/Edifact/Transport.pm >@@ -230,14 +230,14 @@ sub ftp_download { > ) > or return $self->_abort_download( > undef, >- "Cannot connect to $self->{account}->host: $EVAL_ERROR" >+ "Cannot connect to " . $self->{account}->host . ": $EVAL_ERROR" > ); > $ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex( $self->{account}->password ) ) > or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" ); > $ftp->cwd( $self->{account}->download_directory ) > or return $self->_abort_download( > $ftp, >- "Cannot change remote dir : $ftp->message()" >+ "Cannot change remote dir : " . $ftp->message() > ); > my $file_list = $ftp->ls() > or return $self->_abort_download( $ftp, 'cannot get file list from server' ); >@@ -278,14 +278,14 @@ sub ftp_upload { > ) > or return $self->_abort_download( > undef, >- "Cannot connect to $self->{account}->host: $EVAL_ERROR" >+ "Cannot connect to " . $self->{account}->host . ": $EVAL_ERROR" > ); > $ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex( $self->{account}->password ) ) > or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" ); > $ftp->cwd( $self->{account}->upload_directory ) > or return $self->_abort_download( > $ftp, >- "Cannot change remote dir : $ftp->message()" >+ "Cannot change remote dir : " . $ftp->message() > ); > foreach my $m (@messages) { > my $content = $m->raw_msg; >@@ -318,7 +318,7 @@ sub sftp_upload { > port => $port, > timeout => 10, > ); >- $sftp->die_on_error("Cannot ssh to $self->{account}->host"); >+ $sftp->die_on_error( "Cannot ssh to " . $self->{account}->host ); > $sftp->setcwd( $self->{account}->upload_directory ) > or return $self->_abort_download( > $sftp, >-- >2.39.5
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 39904
:
182458
|
182463
|
182555
|
182556