Problem/Motivation
In PHP 8.2, dynamic properties are deprecated. At least one class in Diff does not declare all the properties that can be created on its instances.
Steps to reproduce
- Install a Drupal 7 site on PHP 8.2.
- Download and enable the latest versions of Diff, Features, and Features UI submodule.
- Create a Feature and enable it.
- Override some of the configuration controlled by the Feature.
- Visit the "Review overrides" tab to see a diff of the Feature.
- Note the following PHP warnings:
Deprecated function: Creation of dynamic property _DiffEngine::$ychanged is deprecated in _DiffEngine->diff() (line 145 of /diff/DiffEngine.php).
Deprecated function: Creation of dynamic property _DiffEngine::$xchanged is deprecated in _DiffEngine->diff() (line 145 of /diff/DiffEngine.php).
Deprecated function: Creation of dynamic property _DiffEngine::$yv is deprecated in _DiffEngine->diff() (line 146 of /diff/DiffEngine.php).
Deprecated function: Creation of dynamic property _DiffEngine::$xv is deprecated in _DiffEngine->diff() (line 146 of /diff/DiffEngine.php).
Deprecated function: Creation of dynamic property _DiffEngine::$yind is deprecated in _DiffEngine->diff() (line 147 of /diff/DiffEngine.php).
Deprecated function: Creation of dynamic property _DiffEngine::$xind is deprecated in _DiffEngine->diff() (line 147 of /diff/DiffEngine.php).
Deprecated function: Creation of dynamic property _DiffEngine::$lcs is deprecated in _DiffEngine->_diag() (line 293 of /diff/DiffEngine.php).
Deprecated function: Creation of dynamic property _DiffEngine::$seq is deprecated in _DiffEngine->_diag() (line 294 of /diff/DiffEngine.php).
Deprecated function: Creation of dynamic property _DiffEngine::$in_seq is deprecated in _DiffEngine->_diag() (line 295 of /diff/DiffEngine.php).
Proposed resolution
Add the annotation to allow dynamic properties to the class. Another solution would be to declare all the properties in the class.
Remaining tasks
Patch and test.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | diff-dynamic-properties-php82-3403245-9.patch | 580 bytes | michelle |
Issue fork diff-3403245
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
cboyden commentedPatch is attached.
Comment #9
michelleAdded the fix to another class that needs it.
Comment #10
joelpittetYes this helped, thank you both
Comment #11
heddnCommited #9. Thanks for your contributions.