Closed (fixed)
Project:
Date
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2007 at 17:45 UTC
Updated:
5 Mar 2007 at 15:46 UTC
Here is the original function.
/**
* Logic for telling when a field value is required.
*/
function date_is_required($field, $column, $delta, $value1, $value2) {
if ($column == 'value2' && ($field['todate'] == 'required' && ($value1 || $delta == 0))) {
return TRUE;
}
elseif ($column == 'value' && ($field['required'] || $delta == 0)) {
return TRUE;
}
return FALSE;
}
IMO in the second case when validate the "from date" field, the value of the ($field['required'] && $delta == 0) is logical.
In the actual case I run into a problem. field was validated because of $delta = 0 even if it was not set to required.
Because the form value that I posted was empty a validation is occured on my null value and a form_set_error fired.
patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| date_required_check.5-1.patch | 715 bytes | energie |
Comments
Comment #1
karens commentedillogic indeed! You're right, thanks for the patch. Committed to all branches.
Comment #2
(not verified) commented