Problem/Motivation
Due to a recent version upgrade, all of a sudden a "Remove" button started appearing on the repeat settings:

But if repeat="never", then this button doesn't do anything when you click it (the repeat-section of the form reloads and displays the same thing). This just adds confusion: "What would this remove? Will it clear out the entire date field?"
Steps to reproduce
1. Set up a smart date field to allow recurrence
2. create/edit an entity with the field
3. immediately hit "Remove". Observe the reload, but nothing has changed
4. Set the recurrence to something other than "never"
5. hi "Remove". Observe that the recurrence settings were removed
Proposed resolution
"Remove" should only appear if repeat!="never"
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2026-10-13 at 4.04.34 PM.png | 61.89 KB | dalin |
Issue fork smart_date-3630720
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
adityarawat_ln commentedI reproduced the issue and implemented a proposed fix.
The Remove button is now controlled by the Repeat selection:
- When Repeat is set to Never, the Remove button is hidden.
- When a recurrence option other than Never is selected, the Remove button is displayed.
This uses Drupal Form API states to update the button's visibility dynamically when the Repeat selection changes.
I have created a merge request with the proposed changes. Feedback and testing are welcome.
Thank you