Problem/Motivation
When a site contains a Webform without any elements, visiting the Status report triggers the following warning on PHP 8.1:
Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in webform_requirements() (line 175 of modules/contrib/webform/includes/webform.install.requirements.inc).
Steps to reproduce
- Add a Webform, but do not any elements
- Visit /admin/reports/status
Proposed resolution
Add a sanity check to webform_requirements() to prevent checking empty data.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3276925-2.patch | 6.7 KB | idebr |
| #2 | 3276925-2-test-only.patch | 6.04 KB | idebr |
Comments
Comment #2
idebr commentedAttached patch adds a sanity check to webform_requirements() to prevent checking empty data.
Comment #3
anneke_vde commentedLooks good, the deprecation notice is gone when I applied the patch.
Comment #4
jrockowitz commentedFixed in 6.2.x @see #3279930: Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in webform_requirements()