Deprecation messages with PHP 8: Creation of dynamic property...

Created on 26 March 2023, over 1 year ago
Updated 28 April 2024, 7 months ago

Problem/Motivation

In PHP 8 - PHP 8.2 at least - PHP deprecation messages are being logged from backup_migrate.

For example:

On my site, I have seen this message being logged for the following properties:

  • backup_migrate_files_destination_archivesource::$settings
  • backup_migrate_files_destination_archivesource::$name
  • backup_migrate_files_destination_archivesource::$location
  • backup_migrate_files_destination_archivesource::$machine_name
  • backup_migrate_destination::$settings
  • backup_migrate_destination_filesource::$settings
  • backup_migrate_destination_filesource::$name
  • backup_migrate_destination_filesource::$location
  • backup_migrate_destination_filesource::$machine_name

Steps to reproduce

  1. Navigate to /admin/config/system/backup_migrate - this produces the messages
  2. Navigate to /admin/reports/dblog, select Type "php" and Severity "debug", press "Filter"
  3. Debug messages similar to the example above have been logged

Proposed resolution

From the error message, I understand that this happens because in PHP 8, all class properties must be declared before use, and from the example above, perhaps backup_migrate_files_destination_archivesource::$settings was not declared. I did not look at the code though, it may be another root cause.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡«πŸ‡·France Krizalys

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024