Skip to content

[DEFECT] Checkbox and Date fields fail to persist when jQuery is included via Custom Field (VTL) #34288

@nicobytes

Description

@nicobytes

Problem Statement

We are experiencing data loss during the content save process when an external library (specifically jQuery) is injected via a Custom Field using a VTL script.

When a user attempts to save content, the operation reports "Success," but values entered into Checkbox and Date fields are not persisted to the database. Upon reloading the content, these fields appear empty or reset to default. Interestingly, other field types (such as Radio fields) persist correctly, suggesting the issue is specific to how certain field data formats are handled or serialized when jQuery interferes with the DOM or the submission process.

Removing the Custom Field or the script reference immediately resolves the issue, restoring normal save functionality

Steps to Reproduce

  1. Create a VTL file (e.g., jquery.vtl) with this content <script src="/https/github.com/jquery.js"></script>
  2. Go to Content Model > Content Types and create a new type (e.g., "Bug Test").
  3. Add the following fields to the Content Type:
    Checkbox Field (Values: Option 1, Option 2)
    Date Field
    Radio Field (Control group)
    Custom Field
  4. In the Custom Field properties, add code to parse the VTL file: #dotParse('/jquery.vtl')
  5. Fill out all fields (Check a box, select a radio option, pick a date).
  6. Click Save (or Save & Publish).
  7. Close the content editor and re-open the item.

Observed Behavior: The Radio field retains its value. The Checkbox and Date fields are empty/reset.

Expected Behavior: All fields, including Checkbox and Date fields, should persist their values regardless of jQuery being loaded in a Custom Field.

support-5.mp4

Note: The same behavior happens in the new edit mode

Image

Acceptance Criteria

Checkbox and Date field values must be successfully saved to the database when jQuery is present in the DOM via a Custom Field.

dotCMS Version

latest

Severity

Critical - System unusable

Links

https://dotcms.freshdesk.com/a/tickets/34948

Metadata

Metadata

Assignees

Type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions