Interval cannot be set to 1

Created on 29 July 2023, 11 months ago
Updated 15 December 2023, 6 months ago

Problem/Motivation

The value for the interval field can only be set to 2 or higher for the saved value to be displayed in the node edit form. If the value of the interval field on the node edit form is set to 1, the placeholder value of '# of' is displayed instead of '1'. This can be confusing to content editors as it looks as if no value has been entered.

Steps to reproduce

1. Add a field of type Smart Date inline range
2. Add a date to the field and set to recur every 1 months that ends after 2 times
3. Save the node
4. Edit the node again and the interval field (with the label 'Repeats every') displays the placeholder value of '# of'
5. Change interval to a value of 2 or higher and save
6. Edit the node again and the interval field displays the value that was input

Proposed resolution

Update the Smart Date Recur module to allow a value of 1 to be saved and displayed in the node form.

🐛 Bug report
Status

Needs review

Version

4.0

Component

Smart Date Recur

Created by

🇺🇸United States thefancywizard

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @thefancywizard
  • Status changed to Needs review 11 months ago
  • 🇮🇳India yash_khandelwal Mumbai

    #2 patch is working fine for me, @thefancywizard, please review this patch and apply.

  • 🇨🇦Canada mandclu

    To clarify, for the sake of recurring dates, one is actually the default value. That's the reason it isn't currently stored.

    I understand the perspective that for an editor it may seem strange to see a value explicitly set not displayed the next time the content is edited. From a data management standpoint it also seems strange to me to to have some content that doesn't store a value (because they use the default) and some that store a value (matching the default) that behave the same.

    If the UX of the current widget is confusing to some, then I'm open to discussion about changing it, but I'm not sure the change in the current patch is the best way to address it. If anything, I'd be more inclined to set 1 as the default value in the form element, but still not store it.

  • 🇺🇸United States sassafrass

    Thanks for the patch. I found it very confusing to not have the value 1 save. It wasn't intuitive to me that it was the default; I thought it was broken.

Production build 0.69.0 2024