-
Notifications
You must be signed in to change notification settings - Fork 480
Description
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
- Create a VTL file (e.g., jquery.vtl) with this content
<script src="/https/github.com/jquery.js"></script> - Go to Content Model > Content Types and create a new type (e.g., "Bug Test").
- Add the following fields to the Content Type:
Checkbox Field (Values: Option 1, Option 2)
Date Field
Radio Field (Control group)
Custom Field - In the Custom Field properties, add code to parse the VTL file:
#dotParse('/jquery.vtl') - Fill out all fields (Check a box, select a radio option, pick a date).
- Click Save (or Save & Publish).
- 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
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
Labels
Type
Projects
Status