diff --git a/Koha/File/Transport/FTP.pm b/Koha/File/Transport/FTP.pm index 5600bd4db8..e6ad0c49d3 100644 --- a/Koha/File/Transport/FTP.pm +++ b/Koha/File/Transport/FTP.pm @@ -232,7 +232,9 @@ sub _list_files { my $size = $self->{connection}->size($name); push @file_list, { filename => $name, + longname => undef, size => $size, + perms => undef, mtime => $self->{connection}->mdtm($name), type => defined $size ? 'file' : 'directory', }; diff --git a/t/db_dependent/Koha/File/Transport/FTP.t b/t/db_dependent/Koha/File/Transport/FTP.t index e781a2f8e3..b1bdc19b91 100755 --- a/t/db_dependent/Koha/File/Transport/FTP.t +++ b/t/db_dependent/Koha/File/Transport/FTP.t @@ -211,7 +211,7 @@ subtest 'list_files() MLSD tests' => sub { }; subtest 'list_files() NLST fallback tests' => sub { - plan tests => 10; + plan tests => 11; $schema->storage->txn_begin; @@ -277,6 +277,11 @@ subtest 'list_files() NLST fallback tests' => sub { is( $subdir->{type}, 'directory', 'SIZE failing is treated as a directory' ); is( $subdir->{perms}, undef, 'perms stay undef on the NLST fallback path' ); + ok( + exists( $quote->{longname} ) && exists( $quote->{perms} ), + 'longname and perms keys are present (as undef) on the NLST fallback path, matching the MLSD/SFTP/Local shape' + ); + $transport->{connection} = undef; $schema->storage->txn_rollback;