Problem/Motivation
When using this module with PHP 8.1 deprecation notices are generated:
PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /var/www/html/web/modules/contrib/forms_steps/src/Service/WorkflowManager.php on line 138
Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /var/www/html/web/modules/contrib/forms_steps/src/Service/WorkflowManager.php on line 216
The issue is that the $currentRoute variable may be null but preg_match only accepts the string type.
Steps to reproduce
Use the module with PHP 8.1 and look at the logs.
Proposed resolution
Check that $currentRoute is not null before using it in preg_match
Comments
Comment #3
chfoidl commentedComment #4
chfoidl commentedComment #5
tahiche commentedI´m a total contributing noob, but i wanted to share a patch based on the above fork, in cas it helps anyone...
It applies to the "8.x-1.5" version.
Comment #6
thtas commentedUpdated for latest 8.x-1.x branch
Comment #7
nicoloye commentedChanges work as a charm, thanks!
Comment #9
nicoloye commentedPushed to dev branch. Thanks for the amazing work.