dotCMS / dotCMS/core

[DEFECT] Language Variable Selector Incorrectly Shown in JSON Field Editor

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

The JSON field editor in the new content editor displays a language variable selector button that allows users to insert Velocity syntax (e.g., $text.get('label.yes')), but the backend does not support Velocity evaluation in JSON fields. This creates a confusing user experience where:

  1. Users see the feature: The UI displays a language variable selector button in JSON field editor
  2. Save fails without quotes: When users insert unquoted Velocity syntax, they get validation error: "Invalid JSON field provided"
  3. Saves but doesn't evaluate: When wrapped in quotes, JSON saves successfully but Velocity syntax is stored as literal string and NOT evaluated when retrieved via Content API
Steps to Reproduce

Detailed steps:

  1. Navigate to Content Types → Edit a content type with a JSON field
  2. Create or edit content using this content type
  3. In the JSON field editor, observe the language variable selector button (globe icon) in the top-right corner
  4. Click the language variable selector button
  5. Select a language variable (e.g., $text.get('label.yes'))
  6. The Velocity syntax is inserted into the JSON field
  7. Attempt to save the content
  8. Result:
    • If unquoted: Error "Invalid JSON field provided"
    • If quoted: Saves successfully, but when retrieved via Content API, the Velocity syntax is returned as literal string (not evaluated)
Acceptance Criteria
  • Language variable selector button should NOT be displayed for JSON fields, OR
  • If displayed, Velocity syntax should be evaluated when content is retrieved via Content API
dotCMS Version

Latest evergreen

Severity

Low - Minor issue or cosmetic

Links

https://dotcms.freshdesk.com/a/tickets/35089
https://dotcms.slack.com/archives/C08F8NZRK9S/p1768933183860019
https://dotcms.slack.com/archives/C08F8NZRK9S/p1768933616813999

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 at the new content editor's JSON field editor and trace the language variable selector entry point, then reproduce the unquoted and quoted cases described in the issue. Done means the selector is absent for JSON fields, or the inserted Velocity syntax is evaluated when the content is retrieved through the Content API.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.