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?

Comments

erikwebb’s picture

Version: 6.x-2.0 » 6.x-2.2
Priority: Normal » Major
StatusFileSize
new659 bytes

Not sure what the culprit is, but patch is attached.

Upgrading to major as CCK integration is pretty vital for any D6 form.