Warning: Undefined array key "description" in token_node_menu_link_submit()

Created on 11 October 2023, 9 months ago
Updated 21 October 2023, 8 months ago

Problem/Motivation

Warning: Undefined array key "description" in token_node_menu_link_submit() (line 741 of modules/contrib/token/token.module)

Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in token_node_menu_link_submit() (line 741 of modules/contrib/token/token.module).

Steps to reproduce

Install 'token' module and try to create a node or edit the existing node of any node type.
I am using Drupal Version - 10.1.5, and PHP Version - 8.1.21

Proposed resolution

Add this line $entity->description->value = trim($values['description'] ?? '');
instead of $entity->description->value = trim($values['description']);

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.12

Component

Code

Created by

🇮🇳India Nishant

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

Comments & Activities

Production build 0.69.0 2024