PHP 8.1 errors if only Book name (and no chapter or verse reference) is selected

Created on 9 December 2022, about 2 years ago
Updated 4 January 2024, 12 months ago

Problem/Motivation

I noticed two error messages under PHP 8.1 when only the book name field of the bible reference is provided (and no chapter and verse numbers are added). Drupal 9.4 throws the following errors under these conditions:

Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() (line 358 of core/lib/Drupal/Component/Utility/UrlHelper.php). (.....)

Deprecated function: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Html::escape() (line 424 of core/lib/Drupal/Component/Utility/Html.php). (......)

Steps to reproduce

  1. With PHP 8.1 on server, add a bible reference field to a form (field is set to not required).
  2. Fill in the bible book name without the chapter and verse number.
  3. The error above is generated.

Error is gone if chapter number is provided.

🐛 Bug report
Status

Closed: cannot reproduce

Component

Code

Created by

🇮🇪Ireland marksmith

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

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