Currently in the Date module 7.x-2.6 version, when using repeat fuctionality on the field.
Repeats - daily.
There is a section with radio buttons - "Stop repeating".
There are two options: "after" and "on".
When the radio button is selecting "on" and a valid date is entered, the value within after is also validated, causing "Count must be a positive integer." validation error.
Possible solution:
I think based on the selection of the radio button, the validation needs to be conditional for the next fields.
Example: When after is selected, validation for "count" field should be skipped.
I need solution or opinion on how much work is this, because when I looked into the form element generation method, I got lost within this 500+ lines element pre-process super method.
Comments
Comment #1
k.minkov CreditAttribution: k.minkov commentedI am providing a patch for the issue. It creates a custom validator for the count field that applies validation to it only when "After" is selected. The patch is appliable against version 2.6 too.
Comment #2
k.minkov CreditAttribution: k.minkov commentedComment #4
k.minkov CreditAttribution: k.minkov commentedSubmitting new version of the patch.
Comment #5
podarok#4
should be repeat, not reapeat in function name
and we needs testing here,
Comment #6
k.minkov CreditAttribution: k.minkov commentedOhh yes that is a stupid mistake. About tests I added a line which I think is enough to validate this behavior , although if you suggest to create a separate test case for this I may think of it.
Comment #7
podarokre #6
code coverage is good, but better to see few check lines for it, cause it is very design specific and someone can never grok it in the feature...
Comment #8
k.minkov CreditAttribution: k.minkov commentedThis way is a little more self explanatory. Hope it is ok now.
Comment #10
k.minkov CreditAttribution: k.minkov commentedHere is a refined version.
Comment #11
ndobromirov CreditAttribution: ndobromirov commentedAssuming the last version in #10 is the best one, I am hiding the previous patches, to make it more visible.
Comment #14
geek-merlinCrosslinking related issue: #2726843: Repeat-after usability flaw which is about disabling fields per states api.
Comment #15
ndobromirov CreditAttribution: ndobromirov commentedFails tasting, as the patch can not be applied, so needs a re-roll.
Comment #16
Pradnya Pingat CreditAttribution: Pradnya Pingat at Blisstering Solutions commentedI am working on rerolling patch.
Comment #17
Pradnya Pingat CreditAttribution: Pradnya Pingat at Blisstering Solutions commentedreroll patch added.
Comment #18
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 3 year patch in #17 to date_repeat does not apply to the latest 7.x-2.x-dev and may be too old to easily reroll, but I went ahead and tagged the issue accordingly.