From 72bb057ecf426045a7e4e97e5dcabcc790d5143d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 16 Jul 2026 15:18:50 +0100 Subject: [PATCH] Bug 43088: Reuse _current_directory() instead of duplicating pwd() calls _change_directory(), _list_files() and _is_connected() each called $self->{connection}->pwd directly for their log payloads/connectivity check, duplicating exactly what _current_directory() now provides as a proper, documented internal accessor. Route them through it instead - no behaviour change, just removing the duplication now that the wrapper exists. Test plan: 1. prove -r t/db_dependent/Koha/File/ => All tests successful (32 tests), including the existing current_directory() and list_files()/change_directory() coverage. 2. koha-qa.pl -v 2 --more-tests => [PASS], no critic/pod warnings. Signed-off-by: David Nind Signed-off-by: Andrew Fuerste Henry Signed-off-by: Lucas Gass --- Koha/File/Transport/FTP.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/File/Transport/FTP.pm b/Koha/File/Transport/FTP.pm index 11ab02f539..6a5e775f63 100644 --- a/Koha/File/Transport/FTP.pm +++ b/Koha/File/Transport/FTP.pm @@ -165,7 +165,7 @@ sub _change_directory { type => 'success', payload => { directory => $remote_directory, - pwd => $self->{connection}->pwd + pwd => $self->_current_directory } } ); @@ -267,7 +267,7 @@ sub _list_files { type => 'success', payload => { count => scalar @file_list, - pwd => $self->{connection}->pwd + pwd => $self->_current_directory } } ); @@ -382,7 +382,7 @@ Internal method to check if transport is currently connected. sub _is_connected { my ($self) = @_; - return $self->{connection} && $self->{connection}->pwd(); + return $self->{connection} && $self->_current_directory(); } =head3 _abort_operation