Skip to content

Category fields lose their value on save after a workflow action re-fetches the contentlet #35529

@oidacra

Description

@oidacra

Problem Statement

In the new Edit Content experience, after firing any workflow action that re-fetches the contentlet (e.g. Reset Workflow, or any action that includes reset-workflow as a sub-action — basically anything that updates the contentlet's modDate), required CATEGORY fields visually retain their selected chips, but the form control value silently reverts to a CSV string. The next save sends an empty array to the backend and gets rejected with "field required":

// Save payload after Reset Workflow:
{ "audience": [], "navigationLocation": [], ... }
// Backend response:
{
  "errors": [
    { "errorCode": "required", "fieldName": "navigationLocation",
      "message": "The field Navigation Path is required." },
    { "errorCode": "required", "fieldName": "audience",
      "message": "The field Audience is required." }
  ]
}

A secondary symptom comes from the same root cause: an internal Angular error during form rebind (There is no FormControl instance attached to form control element with name: 'navigationLocation') aborts the rebind loop, leaving some sibling inputs visually stuck in a disabled / loading state.

Impact: any user editing content with required category fields cannot save after running a workflow action that re-fetches the contentlet. Browser: any. Affects new Edit Content only (legacy edit-content is unaffected).

Steps to Reproduce

  1. Open a contentlet with required CATEGORY fields (e.g. Job Aid Article with audience and navigationLocation).
  2. Verify chips are visible for the saved categories.
  3. Modify any field (e.g. title) and click Publish — succeeds (200).
  4. Click Reset Workflow.
    • Observe: chips remain visible, but some inputs (the category fields) appear stuck in disabled/loading state.
  5. Modify the title again.
  6. Click Publish (or any save action) → Bad request error: "The field Navigation Path is required."

Inspect the request payload — audience and navigationLocation are sent as empty arrays despite chips being visible.

Acceptance Criteria

  • After firing any workflow action that re-fetches the contentlet (Reset Workflow included), the form control value for CATEGORY fields remains an array of inodes (not a CSV string).
  • Subsequent Publish/Save sends the correct inode array payload for category fields and is accepted by the backend.
  • No There is no FormControl instance attached errors are emitted to the console during form rebind after a workflow action.
  • After Reset Workflow, no inputs remain stuck in a disabled/loading state.
  • categoryResolutionFn is no longer routed through castSingleSelectableValue — CATEGORY initial values stay as arrays end-to-end.
  • Optional categories (no value saved on the contentlet) continue to validate as empty and submit [] to the backend; required categories with no value continue to fail Validators.required as before.
  • Existing flows are unaffected: first load with categories populated (no workflow action), adding/removing chips via the dialog, saving a brand-new contentlet.

dotCMS Version

Latest from main (reproduced on local dev branch off main at 2026-04-30).

Severity

High - Major functionality broken

Links

NA

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions