🐞 Issue Template · “Field Overwritten on Save”

Short title: Date reported: Reporter: Initial priority:


1. Problem Statement

Item Details
Field(s) affected
Content type(s)
Observations
Impact

2. Environment Snapshot

Layer Value
Drupal core
PHP
Database
Environment
Git commit
Config export hash

Enabled Modules (custom + contrib)

drush pm:list --type=module --status=enabled


3. Roles & Permissions

Role tested uid Key permissions Result
Content Manager edit own content, create menu links, …
Site Administrator 1 full

4. Reproduction Matrix

Vector ✅ Works ❌ Fails Notes
Node form (classic)
Quick Edit inline
Layout Builder block form
REST / JSON:API PATCH
Drush node:save impersonated
Exact steps for the failing vector(s)
  1. Log in as Content Manager (UID 234).
  2. Edit About Us page (/node/15/edit).
  3. In the Menu settings tab, set Parent link = Main > Company.
  4. Click Save.
  5. Observed: Parent resets to Main (root).
  6. Expected: Should stay Main > Company.

5. Logs & Instrumentation

Timestamp Level Message
2025-06-23 14:02:11 notice menu_parent_debugger – UID 234 saving node 15: parent main.companymain
  • Browser console:
  • Network tab:
  • watchdog / Syslog:

6. Possible Influencers Checklist

  • Custom hook_form_alter() / hook_entity_presave() targeting this field
  • Workflow modules (Content Moderation, Workbench)
  • Field permissions or uneditable field value gets stripped
  • Default parent configured in Structure → Content types → … Menu settings
  • JavaScript resetting select value on change events
  • Multilingual menu translations (langcode mismatch)
  • Contrib modules: Pathauto, Menu Item Extras, Book, Redirect, Paragraphs + IER

7. Attachments

  • Full request/response JSON (if API involved)
  • Screenshots / Screen recording
  • Sanitized DB dump or Config export (optional)

8. Acceptance Criteria

  • Saving a node as any role does not change the field unless the user explicitly edits it.
  • Regression test exists (Kernel/Functional).
  • No new PHP warnings, JS errors, or watchdog entries after fix.

9. Initial Triage Notes (for devs/reviewers)

  • Suspect missing permission “Administer menu items”. Granting it on staging prevents overwrite.
  • menu_parent_debugger log confirms value is correct before entity save, wrong after → likely MenuLinkContent::postSave() override.

10. Changelog & Links

Date Author Note
2025-06-23 Daniel Template created