Argument #1 ($ftp) must be of type FTP\Connection, null given in ftp_systype()

Created on 14 January 2023, almost 2 years ago
Updated 22 December 2023, 12 months ago

Problem/Motivation

Version 7.x-3.10, PHP 8.0.23 and also PHP 8.1.10, Drupal 7.94.
Connections to FTP servers do not work with the error message:

TypeError: ftp_systype(): Argument #1 ($ftp) must be of type FTP\Connection, null given in ftp_systype() (Zeile 200 von /data/web/1/000/093/862/375634/htdocs/sites/all/modules/backup_migrate/includes/destinations.ftp.inc).

Steps to reproduce

Open Backup setting, Destinations, click "list files" (BTW: not translated to German) of an FTP destination.

Proposed resolution

Based just on the error message/not checked on the source code: Use an argument type either accepting null, like ?FTP\Connection, or else no argument type at all.

🐛 Bug report
Status

Closed: duplicate

Version

3.10

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands BrankoC

    I am marking this as a duplicate of FTP error with php 8.0 🐛 FTP error with PHP 8.0 Fixed , even though this issue is older and has perhaps a better title. Reason: the other issue has more comments.

    I will edit the other issue to include your steps to reproduce.

Production build 0.71.5 2024