Needs review
Project:
AHAH helper
Version:
6.x-2.2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Mar 2009 at 16:27 UTC
Updated:
5 Oct 2011 at 19:59 UTC
Jump to comment: Most recent file
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.