Problem/Motivation

When you first add a node to a menu, the menu link title will default to be the same as the node title. You probably didn't even notice. But when you change the node title, you will likely be confused that the menu link title hasn't been updated.

We have a team of about a dozen experienced content editors. Even they are often confused by this.

Steps to reproduce

  1. Create node, fill the node form including adding it to a menu
  2. Save
  3. Re-edit the node, change the node title
  4. Save
  5. Be confused at why the menu link title is still the old text

Proposed resolution

Show a warning message if the node title has changed, but the menu title hasn't.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Issue fork drupal-3178623

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

dalin created an issue. See original summary.

dalin’s picture

Status: Active » Needs review
StatusFileSize
new1.47 KB

The reason for all those if conditions is because there may be additional modules (e.g. auto_entitiylabel) or custom code that could remove those form fields.

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.

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.

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.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.22 KB

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

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.

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

fromme’s picture

Status: Needs work » Needs review

Open MR

needs-review-queue-bot’s picture

Status: Needs review » Needs work

The Needs Review Queue Bot tested this issue.

While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

fromme’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests

Left some comments

Will need test coverage

fromme’s picture

I will check

fromme’s picture

Status: Needs work » Needs review

I added typehint and update validation logic: made it more consistent and understandable.
If it's OK, i will add unit test.

berdir’s picture

Component: entity system » menu_ui.module

I think it would make more sense if that's implemented in the frontend *before* saving, otherwise you have to go back after you already saved and edit it again. Similar to the you have unsaved changes message after reordering.

That said, opinionated things are tricky to do in core. first, it should be in menu_ui, because node module should not depend on menu link stuff, then it needs to handle cases when the node title field isn't displayed and so on.

smustgrave’s picture

Status: Needs review » Needs work

Thanks for taking a look @berdir, if reading correctly there's some feedback about doing before saving.

robert-arias made their first commit to this issue’s fork.

robert-arias’s picture

Added support for 11.2.

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

Status: Needs work » Postponed (maintainer needs more info)

My question now is does this belong in core?

Did just start https://www.drupal.org/project/menu_ui_extras that maybe could house it.

berdir’s picture

Yes, I believe this would better fit in a contrib module

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Going to heavily agree. Crediting those for the work but this doesn't seem to be a feature 80% of users would want or need. Opening a ticket under menu_ui_extras.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.