Can't select a menu "parent link" that's an unpublished node

Created on 16 November 2022, over 1 year ago
Updated 10 March 2023, over 1 year ago

Test coverage comment

I did look at test coverage, but I'm not a testing expert! Best guess: WorkbenchMenuAccessNodeFormTest could be improved with more/different checks related to the menu_parent field. (Vague enough?? 😁)

Problem/Motivation

As a user in a workbench access "section," if the content in the menu in my section is unpublished, I can't select a "parent link" that's for an unpublished page (in the node editing form and when editing the menu link in the Drupal menu admin UI).

FWIW #1: I can edit all of those unpublished pages, and I can see all the menu links via Drupal menu admin UI -- and drag menu items under menu links that are for unpublished pages. I just can't select a "parent link" that's for an unpublished page.

FWIW #2: I don't know if this is actually a workbench_menu_access issue, or a Drupal core issue! (...or a view_unpublished module issue, I suppose?)

Steps to reproduce

  1. Set up workbench access and workbench menu access, and a user in a section, and a menu configured with a WBA section.
  2. Make sure the user role has menu admin permissions, and access to unpublished content (I used view_unpublished module for this last part -- might not be necessary, but mentioning in case it matters).
  3. Create an unpublished node, and add a menu link for that node, in the associated section menu.
  4. Create another node, and add a menu link -- check the "parent link" drop-down, you'll see the menu link you created in the previous step is not available to select as a parent link.
  5. Publish this second node, with a menu link.
  6. Go to the menu admin UI (i.e. /admin/structure/menu/manage/my-section-menu).
  7. Edit the menu link for the published node -- check the "parent link" drop-down, you'll see the menu link for the unpublished node isn't available to select as a parent link.
  8. Go back to the editing screen for the menu overall, with the drag-and-drop interface.
  9. Note that you can see both menu links, and you can drag either under the other (i.e. effectively, you can set a parent link that's for an unpublished node, using the drag-and-drop interface).

P.S. Optionally, place the menu as a block -- if you're logged in as a user with access to the unpublished content, you'll see the entire menu in full, not just published links.

Proposed resolution

Make it so you can select parent links that are for unpublished nodes.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States alison

Live updates comments and jobs are added and updated live.
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 alison

    @agentrickard Gotcha okay, that explanation of the intent of the module makes sense to me.

    So, I tried on a site without workbench_menu_access, *with* view_unpublished, and I found that even users with "View any unpublished content" could not choose an unpublished node as a menu parent. (And, though I didn't uninstall view_unpublished, I did one other check: They also can't select an unpublished node as a menu parent even if they're the author of that unpublished node.)

    That said, users with "Bypass content access control" can choose an unpublished node as a menu parent.

    (But, that's nothing to do with workbench_menu_access -- for now, it's just an interesting detail. It's something I'd like to be different, but it's obviously a core thing.)

    Thank you for the explanation! I consider myself "supported" (i.e. marking closed/works as designed).

Production build 0.69.0 2024