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

  1. Add a Webform, but do not any elements
  2. Visit /admin/reports/status

Proposed resolution

Add a sanity check to webform_requirements() to prevent checking empty data.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 3276925-2.patch6.7 KBidebr
#2 3276925-2-test-only.patch6.04 KBidebr

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
StatusFileSize
new6.04 KB
new6.7 KB

Attached patch adds a sanity check to webform_requirements() to prevent checking empty data.

anneke_vde’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, the deprecation notice is gone when I applied the patch.

jrockowitz’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.