Posted by msoler75 on March 17, 2009 at 4:27pm
| Project: | AHAH helper |
| Version: | 6.x-2.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
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:
<?php
function _ahah_helper_disable_validation(&$form) {
foreach (element_children($form) as $child) {
$form[$child]['#validated'] = TRUE;
_ahah_helper_disable_validation($form[$child]);
}
}
?>To:
<?php
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?
Comments
#1
Not sure what the culprit is, but patch is attached.
Upgrading to major as CCK integration is pretty vital for any D6 form.