Skip to content

Single-option Checkbox/Radio/Select/Multiselect shows raw "label|value" instead of the label #36157

Description

@erickgonzalez

Problem Statement

In the new Edit Contentlet, Checkbox, Radio, Select, and Multiselect fields render their options as label|value pairs, where only the label (the text before the |) should be displayed and the value (after the |) is stored.

When a field has only one option defined (e.g. Yes|yes), the field displays the whole raw value Yes|yes instead of just the label Yes. The label/value split is not applied in the single-option case.

Impact: Any single-option Checkbox/Radio/Select/Multiselect field shows an incorrect, developer-facing label (Yes|yes) to content editors. Cosmetic but visible on real content.

Browser & OS: All (frontend rendering issue).

Steps to Reproduce

  1. Create or edit a content type with a Checkbox (or Radio, Select, or Multiselect) field.
  2. Configure the field with a single option using the label|value format, e.g. Yes|yes.
  3. Open a contentlet of that type in the new Edit Contentlet.
  4. Observe: the option renders as Yes|yes.
  5. Expected: the option renders as Yes (only the label, the text before the |).

Acceptance Criteria

  • A single-option Checkbox field displays only the label (text before |), e.g. Yes|yesYes
  • A single-option Radio field displays only the label
  • A single-option Select field displays only the label
  • A single-option Multiselect field displays only the label
  • The stored/submitted value remains the part after the | (e.g. yes) — only the display label changes
  • Multi-option fields continue to display labels correctly (no regression)
  • An option with no | (e.g. Yes) still displays correctly, using the whole string as both label and value

Suggested Tests

This is a frontend option-parsing/display bug, so the meaningful coverage is Unit.

Unit (Jest/Spectator)

  • Option-parsing helper: "Yes|yes" → label "Yes", value "yes" (the core regression test)
  • Single-option rendering shows only the label for each field type — parameterized across Checkbox, Radio, Select, Multiselect
  • Multi-option input still parses/renders each label correctly (no regression)
  • Option with no | (e.g. "Yes") uses the whole string as both label and value
  • On selection, the component emits/binds the value (yes), not the label

E2E (Playwright)

  • Not worth adding — the display assertion (Yes vs Yes|yes) and the value-on-selection are fully covered by the unit tests; a full E2E spec adds no meaningful coverage for a cosmetic bug.

Integration / Postman

  • No tests worth adding — this is display-only parsing on the frontend; the stored value and API contract are unchanged. (If investigation shows the backend also returns the unsplit value, add an integration check that the saved field value equals yes.)

dotCMS Version

Latest from main branch (new Edit Contentlet)

Severity

Low - Minor issue or cosmetic

Links

NA

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    Status
    QA

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions