Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292626

Unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in Drupal\Core\Entity\Sql\SqlContentEntityStorage::loadFromSharedTables()

$
0
0

Problem/Motivation

Solve warning on PHP 8.1

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

Steps to reproduce

Steps to reproduce:
1. Create new entity type
2. Install newly added entity type
3. Create at least one entity (id: 1)
4. Add map base field to created entity type:

    $fields['data'] = BaseFieldDefinition::create('map')
      ->setLabel(t('Data'))
      ->setDescription(t('A serialized array of additional data.'));

5. load entity
6. Warning will occur

I've tried adding:

->setInitialValue([])

but it does not help

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 292626

Trending Articles