dotCMS / dotCMS/core

[DEFECT] Key/Value pair not properly escaping things like \t in current content edit screen.

Open
#34,284 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

Using the current content edit screen, when adding information to a Key/Value pair, if there happens to be a tab character copied into the value, when publishing an "Invalid JSON" error appears.

Note: This isn't happening in the new Content Edit screen beta.

Steps to Reproduce

https://github.com/user-attachments/assets/48e30784-f88d-4674-8929-20ce2c968e30

In an evergreen demo environment using the current content edit screen, not the beta..

  1. Go to Content Types
  2. Create a new Content Type
  3. Add a Title Field
  4. Add a Key/Value Pair Field.
  5. Save the content type.
  6. Go to the Content Search screen.
  7. Create a new contentlet of the new content type.
  8. In a new TextEdit window, type in a few random characters and then press tab.
  9. Cmd/Ctrl+A to select everything including the tab space and copy.
  10. Add in a title, and a key/value pair, pasting the copied value into the value field.
  11. Try publishing.
Acceptance Criteria

Have the Key/Value field in the current content edit screen correctly escape things like tab characters such as \t

dotCMS Version

Current evergreen. 26.01.05-01

Severity

Medium - Some functionality impacted

Links

https://helpdesk.dotcms.com/a/tickets/34478

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 reproducing the problem in the current, non-beta content edit screen using the listed steps, then trace how the Key/Value field serializes pasted values. Done means a value containing a tab character publishes successfully without an "Invalid JSON" error; the payload names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
content, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.