unserialize(): Passing null to parameter #1 ($data) of type string is deprecated

Created on 11 November 2022, over 1 year ago
Updated 23 May 2023, about 1 year ago

On upgrading our server to use PHP8, on cache clear the below warning appears

Deprecated function: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromSharedTables() (line 611 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

On debugging, it appears that it can be removed by uninstalling this module, so will look into a patch to help resolve the problem.

🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom retrodans

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.

  • Issue was unassigned.
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    If what reported in this issue is a Drupal core bug, should not this issue be closed?

  • Status changed to Closed: duplicate about 1 year ago
  • 🇧🇷Brazil gerson.analista

    The default menu link is requered and always generates a record in "link__options" field of the {menu_link_content_data} table.

    The new field created by the "Translatable menu link uri" module "link_override__options" on {menu_link_content_data} table is optional and his value table can be empty.

    This fact causes the deprecated message in the core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php file around line 602.

                foreach ($columns as $property_name => $column_name) {
                  $column_attributes = $definition_columns[$property_name];
                  $values[$id][$field_name][$langcode][$property_name] = (!empty($column_attributes['serialize'])) ? unserialize($row[$column_name]) : $row[$column_name]; //Deprecated generated here
                }
    

    I marked this problem as active because I was investigating the problem further.
    I have some sites that use this module, I thought I would find a way to avoid the deprecated message directly in this module, but by the way we will have to wait for the problem to be fixed in core of Drupal.

Production build 0.69.0 2024