Generated with the help of an LLM.
Problem/Motivation
The menu edit page's link list turns off drag and drop and the weights when any link in the menu has a pending revision. One draft locks the whole menu, so on a site with Workspaces, editors can't rearrange the menu in Live while a workspace holds link edits.
The restriction came in with #2880152: Convert custom menu links to be revisionable, copied from the taxonomy term overview page in #2880149: Convert taxonomy terms to be revisionable. There, saving under Content Moderation superseded the drafts.
That doesn't apply to menu links. They opt out of Content Moderation in MenuLinkContentHooks::entityTypeAlter(). Parent and weight aren't revisionable, MenuTreeHierarchyConstraint refuses hierarchy changes in pending revisions, and WorkspacesMenuTreeStorage doesn't overlay them.
In a kernel test, updateDefinition() in Live on a link with a pending revision writes no new revision. The pending revision stays latest, and publishing it keeps the Live parent and weight. Of the fields the link list writes, only enabled comes back, and it's already hidden on pending links.
The link list saves without validation. Without the current restriction, a move from Live would write links that EntityWorkspaceConflictConstraint says can only be edited in their workspace. Only parent and weight would change, and the workspace doesn't store those. Still, this issue will need to go past a workspace maintainer.
Steps to reproduce
- Install Workspaces and switch to Stage.
- Edit a custom menu link and save it.
- In Live, open the menu's edit page. Drag and drop is off.
Proposed resolution
Remove the restriction. Keep the enabled checkbox hidden on links with pending revisions, and change the message to say so.
Remaining tasks
- A view from the Workspaces maintainers on
EntityWorkspaceConflictConstraint. - MR.
- Update
MenuUiTest::testMenuUiWithPendingRevisions().
User interface changes
Menus with links that have pending revisions can be reordered. The message changes to "%capital_name contains 1 menu link with pending revisions. Its enabled setting can't be changed here until it's published." (and the plural form).
Introduced terminology
None.
API changes
None.
Data model changes
None.
Release notes snippet
Issue fork drupal-3634966
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
Comment #3
darvanenI've kept this as simple as possible but really I'd like to go one step further.
The message tells screen reader users up front that some links are affected, but the rows themselves just have an empty Enabled cell, which a screen reader reads as nothing. Putting short text in that cell, something like "Unpublished changes", would tell them which links it applies to when they get to each row, and keep the message as the summary.
That overlaps a little with #3566062: Improve messaging around menu links with pending revisions, which is about telling editors which links have pending revisions. Happy to do it here or there, whichever reviewers prefer.