Deprecated function: unserialize()

Created on 11 November 2022, over 2 years ago
Updated 22 May 2023, almost 2 years 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

Active

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 almost 2 years 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.

  • 🇨🇭Switzerland sir_squall

    Hello,

    I just installed this module and I got PHP errors:
    Deprecated function : unserialize(): Passing null to parameter #1 ($data) of type string is deprecated dans Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromSharedTables() (/home/clients/b6be4a8b5bd76d63cc49ffea7dfff886/sites/camps.apolline.art/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php ligne 603)

    I'm using PHP 8.3.14

    Thanks

Production build 0.71.5 2024