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

Created on 11 October 2023, 9 months 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

Postponed: needs info

Version

10.1 โœจ

Component
Menu UIย  โ†’

Last updated about 14 hours ago

No maintainer
Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Nishant

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024