From 3da48d1cb643ab505f9ae03bda346609dbb4e94b Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 12 May 2025 14:48:17 +0000 Subject: [PATCH] Bug 39878: EDIFACT vendor account records sets default port incorrectly for FTP When creating or editing an EDI (EDIFACT vendor record) if the port is left empty it will be set to port 22. This is fine then the service is SFTP, but if FTP is selected the default to 21. Test plan: 1) Enable EDIFACT 2) Create a new EDI Vendor account with the FTP transport selected. Pleave the ports unpopulated 3) Note the saved record has port 22 set 4) Apply this patch 5) Restart all the things! 6) Repeat stepts 1 and 2 7) The port should now be 21 for new ftp site and 22 for new stp sites! --- admin/edi_accounts.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl index 4e58de294bd..410bcb8eaf4 100755 --- a/admin/edi_accounts.pl +++ b/admin/edi_accounts.pl @@ -75,12 +75,12 @@ if ( $op eq 'acct_form' ) { my $password = scalar $input->param('password'); $password = $crypt->encrypt_hex($password); my $fields = { - description => scalar $input->param('description'), - host => scalar $input->param('host'), - username => scalar $input->param('username'), - password => $password, - upload_port => scalar $input->param('upload_port') || 22, - download_port => scalar $input->param('download_port') || 22, + description => scalar $input->param('description'), + host => scalar $input->param('host'), + username => scalar $input->param('username'), + password => $password, + upload_port => scalar $input->param('upload_port') || $input->param('transport') eq 'FTP' ? 21 : 22, + download_port => scalar $input->param('download_port') || $input->param('transport') eq 'FTP' ? 21 : 22, vendor_id => scalar $input->param('vendor_id'), upload_directory => scalar $input->param('upload_directory'), download_directory => scalar $input->param('download_directory'), -- 2.39.5 (Apple Git-154)