Unable to change menu link parent for unpublished node

Created on 13 July 2021, almost 4 years ago
Updated 27 March 2023, about 2 years ago

Problem/Motivation

I have received complains that an editor can't change a menu item for an unpublished node. While it makes sense to have some sort of basic limitation when revisions aren't handled it's not necessary for unpublished content (the default revision is not published).

Steps to reproduce

Create a node draft with menu item.
OR create a node that's initially published, but then archived.
Create a new draft with changes to menu item parent.

Proposed resolution

Don't validate when the default revision is not published.

Remaining tasks

Review, add tests.

User interface changes

none

API changes

none

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Needs work

Version

10.1 โœจ

Component
Node systemย  โ†’

Last updated about 15 hours ago

No maintainer
Created by

๐Ÿ‡ง๐Ÿ‡ฌBulgaria SimeonKesmev

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • 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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States joshuami Portland, OR

    For my client's use case, this is fixed in Drupal 10 with #2807629. If you need it for D9, use the patch from comment 104.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States alphex Atlanta, GA USA

    Drupal 10.2.2 site reporting this is still a problem, despite 2807629 being marked fixed.

    I have a bunch of pages that were built, and saved as unpublished, and now we can't view them as unpublished and we can't change the menu structure of them.

    This is a site using workflow.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom eastdrive

    We had the same problem but 'solved' it for now by hiding the menu inputs on node forms with a hook.

  • ๐Ÿ‡ง๐Ÿ‡ทBrazil adrianopulz Florianรณpolis

    I'm facing a similar issue that looks related. If I edit a page published, any field like body, and save it as a Draft the menu configured lost the parent. When we publish that Draft the menu link will be in the wrong place at the main menu since it has no parent.

    Any solution/suggestion for this issue? The client likes configure the menu links in the nodes and all the time they save a Draft the menu links lost the parent.

  • Status changed to Closed: works as designed about 1 month ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    Removing the constraint would mean changing live menu links when creating pending revisions. Supporting this would require a huge overhaul to the menu system to account for pending revisions. This isn't a Node issue.

    See #2858434: Menu changes from node form leak into live site when creating draft revision โ†’ where this was introduced.

Production build 0.71.5 2024