Fix deprecation on PHP 8.1

Created on 1 June 2022, over 2 years ago
Updated 23 November 2023, 12 months ago

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

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡นAustria chfoidl Salzburg

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024