dotCMS / dotCMS/core

Multi-Select / Checkbox / Tag — reject comma in option stored values to prevent silent data corruption

Open
#35,823 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Problem Statement

For Multi-Select, Checkbox, and Tag fields, the comma is used as the internal delimiter when reading and writing the field's selected values. If an option's stored value itself contains a comma (e.g. Science, Math, and Computer Science), the editor silently splits the value on read, fails to match any real option, and renders the field as deselected. On the next save, the fragmented selection is re-joined incorrectly,

permanently corrupting the stored data with each interaction.

This was first reported in 2023 (#26326) and the symptom — "first item appears deselected" — was addressed via display-side fixes #31039 and #34329. Those fixes did not address the underlying delimiter ambiguity, and the bug still reproduces on demo.dotcms.com in the current Evergreen.

Per engineering (Freddy Montes, Erick Gonzalez ), comma-in-stored-value is not a supported input and is not expected to be supported. The agreed minimum fix is design-time validation in the Content Type editor that rejects option values containing a comma, with a clear error message — rather than allowing data to be saved and later silently corrupted.

Steps to Reproduce
  1. In dotCMS, create or edit a content type that includes a Multi-Select field.
  2. Configure the Multi-Select field with options where at least one stored value contains a comma. Example values:
    • Science, Math, and Computer Science
    • Health, Nutrition, and Exercise Science
  3. Create a new content item using this content type.
  4. Select one or more of the Multi-Select options that contain commas.
  5. Save and publish the content item.
  6. Reopen the published content item and review the Multi-Select field.

Actual result: Selected values that contain commas appear deselected after the content is published. A subsequent save permanently corrupts the stored value (values accumulate or drop with each save cycle).

Expected result: Either (a) commas in option values are properly supported end-to-end, or (b) the Content Type editor rejects option values containing a comma at design time with a clear error, so data cannot be silently corrupted.

Acceptance Criteria
  • The Content Type editor rejects new or edited Multi-Select, Checkbox, and Tag option definitions whose stored value contains a comma, with a clear, user-facing error message that names the offending option and explains the limitation.
  • The validation applies to both the new Angular Content Type editor and the legacy editor.
  • No regression to currently valid option definitions (no comma in stored value).
  • Documentation note added covering the limitation and recommended option-definition pattern.
dotCMS Version

Reproduces on Evergreen (verified on demo.dotcms.com and customer environment 26.04.28-02). Affects all current and historical versions — the delimiter is , in both the new Angular editor and the legacy JSP path.

Severity

Medium - Some functionality impacted

Links

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 by tracing option-definition handling in the new Angular Content Type editor and the legacy editor/JSP path, focusing on where Multi-Select, Checkbox, and Tag stored values are accepted. Verify the validation covers new and edited options, names the offending option, explains the comma limitation, preserves valid definitions, and is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, java
Domain
content, documentation, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.