Deprecated functions explode() and boolean cast after introduction PHP 8

Created on 28 December 2023, 6 months ago
Updated 28 April 2024, 2 months ago

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

๐Ÿ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

๐Ÿ‡ณ๐Ÿ‡ฑNetherlands BrankoC

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024