TypeError: unserialize() upon install (Drupal 10, PHP 8.1)

Created on 29 November 2023, about 1 year ago
Updated 8 December 2023, about 1 year ago

Problem/Motivation

TypeError: unserialize(): Argument #1 ($data) must be of type string, array given in unserialize() (line 34 of modules/contrib/menu_token/src/Service/MenuTokenContextManager.php).

Steps to reproduce

Fresh install of menu_token 9.1.x on Drupal 10.1.5 with PHP 8.1.18. Error appears immediately upon enabling menu_token.

Proposed resolution

Remove serialize and unserialize calls from /src/Service/MenuTokenContextManager.php and /src/Service/MenuLinkTreeMenuToken.php. Add $contextual_replacement_links directly to the State API (you don't need to serialize this).

Remaining tasks

Test patch.

๐Ÿ› Bug report
Status

Needs review

Version

9.1

Component

Code

Created by

๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand djroshi

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024