Problem/Motivation

The MenuLinkContent entity has a 'enabled' base field, that decides if the menu link should be enabled or not. Currently, this is hard coded to be enabled if the menu link is created, and then you will need to use the Menu UI to change whet ever the menu link should be enabled or not.

With contrib/custom code I would like to enable that flag as a exposed field in the integration with the node form, allowing the end user to decide if that menu link should be enabled or not.

This is not possible today without having to override both menu_ui_form_node_form_submit and _menu_ui_node_save.

Proposed resolution

  • Add the field as a value form field, allowing contrib/custom to override that form field i.e. to a checkbox.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3097294

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

johndevman created an issue. See original summary.

johnwebdev’s picture

Status: Active » Needs review
StatusFileSize
new2.08 KB

First patch:

johnwebdev’s picture

Issue tags: +Needs tests
StatusFileSize
new3.91 KB

Second patch. This also updates the constraint of MenuSettingsConstraint. This might be redundant, and could instead be the responsibility for the contrib/custom to ensure it does not behave incorrectly with pending revisions.

johnwebdev’s picture

StatusFileSize
new1.45 KB

Interdiff for 2..3.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

daniellundahl’s picture

StatusFileSize
new3.91 KB

Rerolled to work with 9.1.x

daniellundahl’s picture

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

aramean made their first commit to this issue’s fork.

ranjith_kumar_k_u’s picture

StatusFileSize
new3.87 KB

Re-rolled for 9.4

Status: Needs review » Needs work

The last submitted patch, 12: 3097294-12.patch, failed testing. View results

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Category: Task » Feature request
Issue tags: +Needs issue summary update, +Needs screenshots

Triaging my queue of menu_ui

This appears to be a feature request vs task. Think once we get an MR and summary update with screenshots we should ask UX team for feedback.

johnwebdev’s picture

It's been 6 years, but if i remember correctly there is no UI changes here, we simply expose enabled as a hidden value by default, which allows contrib modules to change it to something like a checkbox.