When I form_altering a form with cck values, inserting some ahah field, on a change event I get a validation errors in required cck fields.
I fixed this with changing this function from:
function _ahah_helper_disable_validation(&$form) {
foreach (element_children($form) as $child) {
$form[$child]['#validated'] = TRUE;
_ahah_helper_disable_validation($form[$child]);
}
}
To:
function _ahah_helper_disable_validation(&$form) {
foreach (element_children($form) as $child) {
$form[$child]['#validated'] = TRUE;
if(isset($form[$child]['#required']))
$form[$child]['#required'] = FALSE;
_ahah_helper_disable_validation($form[$child]);
}
}
It seem to works now. It's okay?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 404974-cck-required-fields-validation-1.patch | 659 bytes | erikwebb |
Comments
Comment #1
erikwebb commentedNot sure what the culprit is, but patch is attached.
Upgrading to major as CCK integration is pretty vital for any D6 form.