Passing null to mb_convert_encoding is deprecated

Created on 30 September 2023, 12 months ago
Updated 10 September 2024, 18 days ago

Problem/Motivation

I'm seeing this frequently:

Deprecated function: mb_convert_encoding(): Passing null to parameter #1 ($string) of type array|string is deprecated in Masterminds\HTML5\Parser\UTF8Utils::convertToUTF8() (line 103 of /code/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php)

#0 /code/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(8192, 'mb_convert_enco...', '/code/vendor/ma...', 103)
#1 [internal function]: _drupal_error_handler(8192, 'mb_convert_enco...', '/code/vendor/ma...', 103)
#2 /code/vendor/masterminds/html5/src/HTML5/Parser/UTF8Utils.php(103): mb_convert_encoding(NULL, 'UTF-8', 'UTF-8')
#3 /code/web/modules/composer/crossword/src/CrosswordDataService.php(544): Masterminds\HTML5\Parser\UTF8Utils::convertToUTF8(NULL, 'UTF-8')
#4 /code/web/modules/composer/crossword/src/CrosswordDataService.php(97): Drupal\crossword\CrosswordDataService->convertCrosswordDataToUtf8(Array)
#5 /code/web/modules/composer/crossword/src/Plugin/Field/FieldFormatter/CrosswordFormatter.php(419): Drupal\crossword\CrosswordDataService->getData(Object(Drupal\file\Entity\File), false)
#6 /code/web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\crossword\Plugin\Field\FieldFormatter\CrosswordFormatter->viewElements(Object(Drupal\file\Plugin\Field\FieldType\FileFieldItemList), 'en')

Steps to reproduce

Go here https://www.crosswordplayground.com/puzzle/basenotes-perfume-crossword-32

Proposed resolution

Probably convert null to an empty string somewhere.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States danflanagan8 St. Louis, US

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

Comments & Activities

Production build 0.71.5 2024