Problem/Motivation

The Token module adds a token_node_menu_link_submit() entity builder to the node form that largely duplicates logic from the menu_ui module.

The menu_ui module has recently been updated to work with draft revisions, see:
- #2858434: Menu changes from node form leak into live site when creating draft revision
- #3041326: Remove 'title' and 'description' from MenuSettingsConstraintValidator when used with content moderation by creating a draft of menu link content when a draft of it's parent content is created

The duplicated code in the Token module has not yet been updated with these changes. As a result, sites that have the Token module installed still leak changes from draft revisions.

Priority critical in line with the related core issue #2858434: Menu changes from node form leak into live site when creating draft revision

Proposed resolution

Update token_node_menu_link_submit() with the recent changes in Drupal Core.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

To be determined.

API changes

To be determined.

Data model changes

To be determined.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr created an issue. See original summary.

idebr’s picture

Attached patch updates token_node_menu_link_submit() with the recent changes in Drupal Core.

The last submitted patch, 2: 3065121-2-test-only.patch, failed testing. View results

Berdir’s picture

Status: Needs review » Needs work
+++ b/token.info.yml
@@ -4,3 +4,6 @@ description: Provides a user interface for the Token API and some missing core t
   - drupal:system (>= 8.5)
+
+test_dependencies:
+  - drupal:content_moderation

This is not necessary, test dependencies are only needed for contrib modules to fetch the dependencies on testbot, this always exists. It's also basically replaced by having a composer.json with require-dev dependencies, which are more flexible and work immediately including in patches.

idebr’s picture

The last submitted patch, 5: 3065121-5-test-only.patch, failed testing. View results

  • Berdir committed 53c5208 on 8.x-1.x authored by idebr
    Issue #3065121 by idebr: Menu changes from node form leak into live site...
Berdir’s picture

Status: Needs review » Fixed

This adds a new public $modules property, but since this is a critical bugfix, I'll commit this and we can fix that in #3040520: Make all $modules properties protected in tests

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.