Hello,

Currently when you have a menu structure with parent and child items and a parent that is linked to a node that is unpublished, the entire parent and child tree disappears in the menu overview.

Now I understand that it would disappear in the actual website, on the front-end. But looking at the menu structure, it completely disappears as well - as if it is externally deleted. This caused quite some confusion for me earlier as I had build a structure and someone unpublished a primary item's node. When I published the node again, the structure happily appeared again.

I feel this is not a good way to deal with unpublished content. My proposal would be to add 'node unpublished' to a menu item that links to an unpublished node. Especially as an admin that has the rights to administer content. Anyway, by all means, I think it would be way better than just making it disappear. Removing from the menu structure = permanently removed in my eyes.

Thanks in advance!
Cheers,
Danny

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Danny_Joris’s picture

On top of that: If you add a menu item to an unpublished node, it will just save, give no warning or error and the menu structure still looks the same. After the node would be published, all your attempts to add that menu item will be visible.

casey’s picture

Version: 6.17 » 8.x-dev
cupcakemuncher’s picture

Status: Needs work » Needs review
FileSize
603 bytes

Hello!
Following patch should fix this issue.
I appologize in advance.
This patch is for Drupal 7.18.
I am aware of the backport policy but currently I do not have a running D8 instance to verify the patch.

Changes are made in menu.inc.
The function menu_tree_check_access() is called from within menu_overview_form() in the menu-module.
Which generates the form used to administer the menu.
It always queries the status of the linked content.
This shouldn't be done when administrating the menu.

Since the global $menu_admin is set but never evaluated, I assum it's purpose to mark the request as coming from an administrator of the menu.
The patch has menu_tree_check_access() query $menu_admin and depending on it's value queries the status of the linked content or not.
Thus allowing for display of an entry linking to unpublished content.
If unpublished content is displayed in the menu-administration-form it should be marked to distinguish it from published content.
Workaround here would be implement hook_form_FORM_ID_alter() and have it pass along an additional css-class.

Version: 8.x-dev » 7.x-dev
Component: menu.module » menu system
Category: bug » task
Status: Active » Needs work

The last submitted patch, drupal core-vanishing entries-887910-3.patch, failed testing.

cupcakemuncher’s picture

Status: Needs review » Needs work
FileSize
603 bytes

Filename without spaces, since uploaded patches seem to be uneditable.

cupcakemuncher’s picture

Status: Needs work » Needs review
johnv’s picture

Marked #1705788: can not see links to unpublished nodes in menu admin (even if i'm uid=1) as duplicated. It has a nice test-script, though:

  1. log in as admin (uid =1).
  2. create a new node, leave it unpublished.
  3. create a link to this node in any menu.
  4. save it.
  5. go back to the link list of that menu.
  6. the link to the node is not there, even though it was saved successfully to the db.
  7. the culprit seems to be menu_tree_check_access().