Problem/Motivation

After fixing issue 3305432, "FTP error with php 8.0", a Drupal 7 install of Backup and Migrate 7.x-3.10 running on PHP 8 will generate the following error messages under the condition that the FTP destination cannot be reached.

  • FTP Error: Couldn't connect to server localhost
  • Warning: Trying to access array offset on value of type bool in backup_migrate_destination_ftp->_list_files() (line 61 of drupal7/sites/all/modules/backup_migrate/includes/destinations.ftp.inc).
  • Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in backup_file->set_file_info() (line 533 of /drupal7/sites/all/modules/backup_migrate/files.inc).
  • Deprecated function: Automatic conversion of false to array is deprecated in backup_file->info_set() (line 286 of /drupal7/sites/all/modules/backup_migrate/includes\files.inc).

This might be confusing to the average user, who won't know which problem to tackle first.

Steps to reproduce

  • Run D7 on PHP 8 or higher.
  • Create an FTP destination that cannot be reached (e.g. use a non-existent server address).
  • Go to /admin/config/system/backup_migrate/backups.

Proposed resolution

Only the error "FTP Error: Couldn't connect to server localhost" should be shown.

Remaining tasks

TBD

CommentFileSizeAuthor
#2 backup_migrate-3411232-01.patch580 bytesbrankoc
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

BrankoC created an issue. See original summary.

brankoc’s picture

StatusFileSize
new580 bytes

This patch seems to make all the above-mentioned messages except the desired one go away.

abhishek_gupta1 made their first commit to this issue’s fork.

abhishek_gupta1’s picture

Status: Active » Needs review

@Alex Andrascu, I have created MR please kindly review it.

keshavv’s picture

Status: Needs review » Reviewed & tested by the community

I can reproduce the issue by following the steps, The given #2 patch works perfectly for me.

damienmckenna’s picture

This looks reasonable.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you.

  • DamienMcKenna committed d6fb1c79 on 7.x-3.x
    Issue #3411232 by BrankoC, keshavv, DamienMcKenna: Deprecated functions...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.