PHP 8.1: Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated

Created on 13 December 2023, 11 months ago
Updated 15 December 2023, 11 months ago

Problem/Motivation

Received this Debug message in PHP 8.1 environment.

Message Deprecated function: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in Drupal\ableplayer\Plugin\Field\FieldFormatter\AbleplayerRemoteVideoFormatter->getVideoId() (line 180 of /app/web/modules/contrib/ableplayer/src/Plugin/Field/FieldFormatter/AbleplayerRemoteVideoFormatter.php)

Steps to reproduce

  1. Add media, in this case a video. The provider is YouTube.
  2. Include YouTube video link for the embed. Leave empty ableplayer_audio_description (URL of Audio Described Video on YouTube or Vimeo).
  3. Message happens when media is rendered using Able Player Remote Video.

Proposed resolution

Pass no null values to preg_match. Generally they are passed as $url in method AbleplayerRemoteVideoFormatter->getVideoId.

Remaining tasks

  • Review MR
πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ikphilip Charlotte, NC, USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024