- π¨π¦Canada mdolnik
The original merged in fix for this issue is not sufficient as it will still cause a validation error when the time is set to midnight as the value resolves to
0which is treated as empty by Drupal core.The original patch supplied in comment
#5had logic inTimeElement::valueCallback()which cast the return value as a string which is missing from both the current1.xand2.xbranches.This string cast is necessary to avoid
FormValidator::doValidateForm()from considering midnight to be empty.
ie: the line with$is_empty_value = ($elements['#value'] === 0);will treat0(midnight) as an empty value where-as it will treat'0'as populated.Regardless I believe the updated patch in
#9should work for anyone needing this fix in1.xand for2.xthere is an open issue 3227128 π Time Field fails required field validation if value is 00:00 Needs work which I think should be used to resolve this in version2.x.