Skip to content

Custom Field type does not show inline validation (red border + mandatory message) when required and left blank on save #35532

@erickgonzalez

Description

@erickgonzalez

Problem Statement

In the new Edit Contentlet mode, when a contentlet with a required Custom Field type is saved — or when any workflow action containing the save actionlet (e.g., Publish) is triggered — while the field is left empty, the field does not display the standard inline validation feedback that other field types show: a red border around the field and a "This field is mandatory" message below it.

The error is only communicated via a generic banner at the top of the form, leaving content editors unable to quickly identify which field failed validation.

Impact: Content editors cannot tell which required Custom Fields are empty at a glance, making the save experience confusing and inconsistent with how other field types behave.

Browser & OS: N/A — UI issue in the new Edit Contentlet mode (Angular frontend).

Steps to Reproduce

  1. Activate the new Edit Contentlet mode for the Persona content type.
  2. Open the Key Tag field configuration and select Recommended Implementation.
  3. Create a New Persona contentlet, leaving the Key Tag field empty.
  4. Click Save — or trigger any workflow action that includes the save actionlet (e.g., Publish).
  5. Observe: an error banner appears at the top of the form, but no red border and no "This field is mandatory" message are shown on the Key Tag field itself.

Expected behavior: A red border appears around the Key Tag field and a "This field is mandatory" message is shown directly below it — consistent with other required field types.

Acceptance Criteria

  • The message "This field is mandatory" appears below the required Custom Field when the save/workflow action is triggered and the field is empty
  • [ ] When clicking Save or triggering any workflow action that includes the save actionlet (e.g., Publish) in the new Edit Contentlet mode, a required Custom Field left empty shows a red border around the field (Out of scope: the red border is not OOTB for Custom Fields — it requires adding CSS inside the Custom Field code itself; see discussion with @oidacra)
  • The original reproduction scenario (Persona content type → Key Tag field with Recommended Implementation → required → Save without filling → no inline validation shown) no longer reproduces for the mandatory message
  • The existing error banner continues to appear alongside the new inline field validation (no regression to current banner behavior)
  • After the user fills in a previously empty required Custom Field and re-triggers the save/workflow action, the "This field is mandatory" message is no longer shown
  • A single E2E test is added that verifies all dotCMS field types (as defined in com.dotcms.contenttype.model.field) display the appropriate validation message when set as required, left empty, and Save is triggered — one test covering all field types, not one per field type

dotCMS Version

Latest from main branch

Severity

Low - Minor issue or cosmetic

Links

Screen.Recording.2026-04-30.at.4.02.29.PM.mov

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions