I create a Webform node that includes two optional date fields, say, Test date 1 and Test date 2.

If I enter the first date, or if I leave both blank, the form works fine.

However, if I enter the second date and leave the first one blank, I get an error when I try to submit the form:
"Entered Test date 2 is not a valid date."

This happens despite that the date is actually valid.

CommentFileSizeAuthor
#2 webform_multiple_date.patch3.95 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Thanks, I've reproduced this bug and I'm working on correcting it.

quicksketch’s picture

Status: Active » Fixed
FileSize
3.95 KB

It looks like the problem was the static variable we were using to validate the month, day, and year together. Because we weren't keeping track of which date element we were validating, empty dates would trigger as being filled out (though with empty values). This patch should correct the problem. I've committed it to CVS.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.