Unable to change menu link parent for unpublished node

Created on 13 July 2021, over 3 years ago
Updated 27 March 2023, over 1 year 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 4 days 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.

Production build 0.71.5 2024