MenuSettingsConstraintValidator is used when creating a draft for content review. The code here only considers editing the parent content as a structural change, but we believe that adding new parent content should also be considered a structural change.

1. Publish a node.
2. When changing a node from Published to Draft, add a new parent to it.
This allows the parent to be added successfully.
We consider that since the structure cannot be changed, adding new content should also be considered a violation of the structure.

In https://www.drupal.org/node/3041326 and https://www.drupal.org/node/3047051, this scenario is excluded.

CommentFileSizeAuthor
#4 3547561-3.patch940 bytesleo liao
#2 3547561-1.patch932 bytesleo liao

Comments

leo liao created an issue. See original summary.

leo liao’s picture

StatusFileSize
new932 bytes
cilefen’s picture

Version: 11.2.x-dev » 11.x-dev
Status: Active » Needs work
Issue tags: +Needs merge request
leo liao’s picture

StatusFileSize
new940 bytes

After publishing, adding a menu in the editing interface will prompt that adding is prohibited. After deleting and saving again, a warning message "Warning: Undefined array key "parent" in Drupal\menu_ui\Plugin\Validation\Constraint\MenuSettingsConstraintValidator->validate()" is displayed.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

darvanen’s picture

Category: Task » Feature request
Status: Needs work » Postponed (maintainer needs more info)

My understanding of how this works is that when you *add* a menu item with a draft, the menu item points at the unublished draft and therefore can't be seen by anonymous users. When the draft is published, the menu item flips to the canonical path.
This has been discussed extensively in #3499181: Disallow saving the current default revision as a non-default revision.

I don't agree with the direction of this issue at the moment.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Since there's been no follow up and agree with @darvanen. If anyone feels super strongly open a ticket under menu_ui_extras but don't think belongs in core.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.