Problem/Motivation
We recently checked a codebase containing Config Distro for PHP 7.4 compatibility using the PHPCompatibility Coding Standard for PHP CodeSniffer.
The following problem was detected within Config Distro:
FILE: /app/web/modules/contrib/config_distro/modules/config_distro_ignore/src/Controller/ConfigDistroIgnoreController.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
26 | ERROR | Using "parent" inside a class without parent is deprecated since PHP 7.4
-------------------------------------------------------------------------------------------------------------------------
Proposed resolution
It looks to me like this class is meant to extend Drupal\config\Controller\ConfigController like ConfigDistroController does.
Remaining tasks
Create patch that adds parent class to ConfigDistroIgnoreController.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3199197-5.patch | 1009 bytes | nginex |
Issue fork config_distro-3199197
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 #3
joegraduateComment #4
bircherHmm, that seems broken.
So rather than add code through inheritance it would be good to check if this class is needed at all, and remove it if not. I don't have an ide handy right now but my first impression is that this is dead code that was left over from some initial development.
Thanks for finding it and thanks for using the module.
Comment #5
nginex commentedComment #6
joegraduateThanks @nginex for the more complete patch.
I checked and ConfigDistroIgnoreController does not appear to be used anywhere so I updated the MR to delete the file entirely as suggested by @bircher instead of modify it.
Comment #7
joegraduateFWIW, we've been using the diff from this MR as a patch on a large number of sites that actively use Config Distro for some time now and have not seen any problems.
Comment #8
lluvigneHi! I'm checking code compatibility with PHP 8 for a site containing config distro and found the same error.
As @bircher sais in #4 seems to be something left over as the class is not being used anywhere. Removing the class doesn't break anything. Moving the issue to RTBC.
Comment #9
joegraduateComment #11
joegraduateThanks all!