JavaScript error when adding a menu link and the node title field is not presented in the edit form

Created on 24 June 2024, 6 months ago

Problem/Motivation

When creating a menu link directly from the node form, the menu_link_weight module tries to copy the title value of the node. This results in a JavaScript error if the title field of the node is not presented, which occurs when the title is automatically generated via the auto_entitylabel module.

The error arises because there's a missing check in the menu_link_weight module's JavaScript code. This check should verify the presence of the title before processing the remaining logic.

Steps to reproduce

  1. Enable the auto_entitylabel module and set a content type to have the title automatically generated. Make sure to select the option "Automatically generate the label and hide the label field"
  2. Try to create a menu link directly from the node form of that content type.
  3. Check the console for any JavaScript errors.

Proposed resolution

Add a check to ensure the title field is present before the logic is processed as it's done in the menu_link module.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇧🇪Belgium bernardopaulino Brussels

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

Comments & Activities

Production build 0.71.5 2024