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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | backup_migrate-3411232-01.patch | 580 bytes | brankoc |
Issue fork backup_migrate-3411232
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
Comment #2
brankoc commentedThis patch seems to make all the above-mentioned messages except the desired one go away.
Comment #5
abhishek_gupta1 commented@Alex Andrascu, I have created MR please kindly review it.
Comment #6
keshavv commentedI can reproduce the issue by following the steps, The given #2 patch works perfectly for me.
Comment #7
damienmckennaThis looks reasonable.
Comment #8
damienmckennaCommitted. Thank you.