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

Created on 11 October 2023, almost 2 years ago

Problem/Motivation

Warning: Undefined array key "description" in _menu_ui_node_save() (line 114 of core/modules/menu_ui/menu_ui.module).
_menu_ui_node_save(Object, Array) (Line: 342)

Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in _menu_ui_node_save() (line 114 of core/modules/menu_ui/menu_ui.module).

Steps to reproduce

While add/edit the node I am facing above issue,
My Drupal Version 10.1.5,
PHP Version 8.1.21
Database Version
10.4.30-MariaDB-1:10.4.30+maria~ubu2004-log

Proposed resolution

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

This will fix the above issue.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Needs work

Version

10.1 โœจ

Component
Menu UIย  โ†’

Last updated 22 days ago

No maintainer
Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Nishant

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

Comments & Activities

Production build 0.71.5 2024