dotCMS / dotCMS/core

New Edit Content editor pre-fills empty Title with the derived (listed-field) value and persists it on save

Open
#36,313 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support Team : Maintenance
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

What's happening

  • When a content type has an empty Title field plus a sibling field marked "Show on Listing" (the customer's "Size"), dotCMS derives a display title from that listed field — this is long-standing, expected behaviour and is what feeds listings, breadcrumbs, relationship labels and the API for ALL content.

  • The NEW Edit Content editor additionally binds the editable Title input to that derived value (it reads the computed contentlet "title" rather than the field's raw stored value). So the user sees "Size" sitting in the Title box even though they never typed it.

  • On Save/Publish the new editor submits that pre-filled value, so the Size value gets PHYSICALLY WRITTEN into the Title column. The old editor never did this (it showed Title empty and stored nothing).

In the new Edit Content editor, when a content type has an empty title field and a sibling field marked Show on Listing (e.g., a text field size), the Title input is auto-populated with the contentlet's derived title (the listed field's value). The user never types in Title, but on Save/Publish, the derived value is physically written into the title column — silently corrupting data.

The legacy editor does not do this: it binds the Title input to the field's raw stored value, so it shows empty and persists nothing. The derived title is expected for listings/breadcrumbs / relationship labels / API (computed via Contentlet.getTitle() / buildName()), but it must not leak into the editable input or be persisted.

Impact: any content type with an empty/optional title field plus a listed sibling field. Front-end (new Edit Content / Angular). Affects data integrity, not just display.

Steps to Reproduce
Steps to Reproduce

Reproduced on demo.dotcms.com (screenshots below):

  1. Create a content type with: a Text field "Title" (var title, Show in List OFF) and a Text field "Size" (var size, Show in List ON).
  2. Enable Edit Content Beta (new editor) on the content type.
  3. Add new content: leave Title empty, set Size = "Large". Save/Publish.
  4. Reopen the contentlet in the new editor → Title shows "Large" (the Size value), though it was never entered.
  5. Confirm persistence: open the same contentlet in the legacy editor (banner "revert" link) → the Title field now contains "Large" → the derived value was written to the stored title column.
  6. (Relationship manifestation) Relate this contentlet as a child of another content type → it appears in the relationship widget under the Title column as "Large".

Expected: Title stays empty; nothing is persisted to the title column unless the user types it.
Actual: The title is pre-filled with the listed field's value and persists on save.

Likely cause/pointers
  • New editor reads contentlet[field.variable] for the title field — i.e., the server-computed title — in textFieldResolutionFn (dot-edit-content-form-resolutions.ts:60–79, line 70; mapping line 315).
  • Form control initialized from it: dot-edit-content-form.component.ts getInitialFieldValue()/createFormControl().
  • Save submits the full form value with no title guard: fireWorkflowAction()/processFormValue().
  • Computed title source (expected): Contentlet.getTitle()/buildName(); ESContentFactoryImpl ~L516–528.
Acceptance Criteria
  • In the new editor, an empty title field binds to the field's raw stored value (empty), not the computed contentlet title — matching legacy behavior.
  • Saving content where the user did not enter a title does not persist the derived value into the title column.
  • Display-title derivation for listings, breadcrumbs, relationship labels, and API is unchanged.
  • Regression test covering: empty title field + listed sibling text field, new editor, save → title column stays empty.
dotCMS Version

Reported on 26.06.04-01; reproduced on demo.dotcms.com (new Edit Content editor). Front-end.

Severity

Medium - Some functionality impacted

Links

https://dotcms.freshdesk.com/a/tickets/37936

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core-web/libs/edit-content/src/lib/components/dot-edit-content-form/dot-edit-content-form-resolutions.ts, especially textFieldResolutionFn, then trace getInitialFieldValue(), createFormControl(), fireWorkflowAction(), and processFormValue() in dot-edit-content-form.component.ts. Compare these with Contentlet.getTitle()/buildName() and ESContentFactoryImpl; done means the empty raw title remains empty on save while derived display titles remain unchanged, with regression coverage for the listed-sibling case.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, java
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.