-
Notifications
You must be signed in to change notification settings - Fork 479
Description
Problem Statement
The charLimit field variable in Block Editor fields displays a visual warning when exceeded but does not prevent content from being saved, allowing users to save content that exceeds the configured character limit.
Steps to Reproduce
When a Block Editor field is configured with a charLimit field variable (e.g., charLimit=100), the editor correctly:
- Displays the character count with the limit (e.g., "150/100 chars")
- Shows the count in red when the limit is exceeded
- Provides visual feedback to the user
However, the character limit is NOT enforced as a validation rule:
- Users can save content that exceeds the character limit
- No validation error is displayed
Screen.Recording.2026-01-14.at.1.31.51.PM.mov
Save button remains enabled
- Navigate to Content → Content Types
- Create or edit a Content Type
- Add/Edit a Block Editor field
- In the field configuration, add a Field Variable:
- Key:
charLimit - Value:
100
- Key:
- Save and publish the Content Type
Testing
- Navigate to Content → Content Search
- Create new content using the Content Type from setup
- In the Block Editor field, type a paragraph with more than 100 characters
- Example: "This is a test paragraph to exceed the character limit. I'm typing more and more text here to make sure we go over one hundred characters and see what happens when we try to save this content."
- Observe that the character counter at the bottom shows red text (e.g., "150/100 chars")
- Click Save or Save & Publish
Result
- Content saves successfully ❌
- No validation error is shown ❌
- Content can be retrieved with 150+ characters ❌
Acceptance Criteria
When a Block Editor field has a charLimit field variable configured:
-
Visual Feedback (Already Working ✅)
- Character count should be displayed
- Count should turn red when limit is exceeded
-
Validation Enforcement (MISSING ❌)
- Form should be marked as invalid when character limit is exceeded
- Save button should be disabled or show validation error
- User should see an error message: "Character limit exceeded. Maximum allowed: 100 characters"
- Content should NOT be saved until character count is within the limit
-
Consistent Behavior
- Character limit validation should behave similarly to other field validators (required, regex, etc.)
dotCMS Version
Evergreen
Severity
Medium - Some functionality impacted
Links
https://dotcms.freshdesk.com/a/tickets/34985
https://dotcms.slack.com/archives/C08MDK1BYLF/p1768423056696419
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done