PHP Fatal error: Declaration of Drupal\Core\DependencyInjection\DependencySerializationTrait::__wakeup() must be compatible with Drupal\search_api\Backend\BackendPluginBase::__wakeup(): void in /app/docroot/core/lib/Drupal/Core/DependencyInjection/Depend

Created on 17 June 2024, 3 months ago

Problem/Motivation

Drupal is throwing an error that breaks the site when using drupal/search_api or any other module that uses type-hinting returns.

Steps to reproduce

Install Drupal 10.2.7 and drupal/search_api: 1.35. Use PHP version 8.2.19. With this configuration I am getting the error:

PHP Fatal error: Declaration of Drupal\Core\DependencyInjection\DependencySerializationTrait::__wakeup() must be compatible with Drupal\search_api\Backend\BackendPluginBase::__wakeup(): void in /app/docroot/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php on line 74.

It worked fine in PHP version 8.2.18

It seems that the attribute #[\ReturnTypeWillChange] for the function __wakeup() in the trait Drupal\Core\DependencyInjection\DependencySerializationTrait is not working as expected in the new version of PHP?

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: duplicate

Version

10.2 ✨

Component
OtherΒ  β†’

Last updated about 8 hours ago

Created by

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

Comments & Activities

Production build 0.71.5 2024