Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PHP Runtime Deprecation Notice: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated #378

@abohntek

Description

@abohntek

Bug Report

Current Behavior
everytime a null object is tried to unserialize this exception occures.

for example, when calling the cart this exception is thrown:

PHP Runtime Deprecation Notice: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in /var/website/current/html/typo3conf/ext/cart/Classes/Controller/Cart/CartController.php line 64

Environment

  • TYPO3 version(s): 11.5.7
  • cart version: 8.2.0
  • PHP: 8.1
  • Is your TYPO3 installation set up with Composer (Composer Mode): yes
  • OS: Debian

Possible Solution
check objects against null before unserialize them like $billingAddress = unserialize($sessionData); would be transformed to $billingAddress = is_null($sessionData) ? null : unserialize($billingAddress);

found sofar inside CartController.php for

$shippingAddress = unserialize($sessionData);

$billingAddress = unserialize($sessionData);

Metadata

Metadata

Assignees

Labels

7.xrelated to TYPO3 v108.xrelated to TYPO3 v10 and v11

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions