By spokje on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
11.3.x
Introduced in version:
11.3.0
Issue links:
Description:
The method handleNullableFieldUnserialize() is added to SqlContentEntityStorage and replaces the use of unserialize() throughout the class. Unlike unserialize(), this method returns NULL if the input value is NULL..
This affects fields using \Drupal\Core\Entity\Sql\SqlContentEntityStorage that have serialized columns that can be NULL if they are not required.
Before
\Drupal\Core\Entity\Sql\SqlContentEntityStorage automatically unserializes these columns, which causes an E_WARNING and a deprecation warning in the event of a NULL value. For example,
Deprecated function: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromSharedTables()
After
The method handleNullableFieldUnserialize() returns NULL if the value is NULL. If not NULL the value is passed to unserialize(). No warning is issued.
Impacts:
Module developers