| 1 |
<?php |
<?php |
| 2 |
// $Id: content_multigroup.node_form.inc,v 1.1.2.10 2009/08/10 04:07:51 markuspetrux Exp $ |
// $Id: content_multigroup.node_form.inc,v 1.1.2.11 2009/11/03 19:04:00 markuspetrux Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 395 |
} |
} |
| 396 |
} |
} |
| 397 |
|
|
| 398 |
if ($group_required && count($non_empty_subgroups) == 0) { |
if (empty($non_empty_subgroups)) { |
| 399 |
form_set_error('', t('Group @name requires one collection of fields minimum.', array('@name' => t($group['label'])))); |
if ($group_required) { |
| 400 |
|
// This multigroup is required, but we have no subgroup of items. |
| 401 |
|
form_set_error('', t('Group @name requires one collection of fields minimum.', array('@name' => t($group['label'])))); |
| 402 |
|
} |
| 403 |
|
else { |
| 404 |
|
// This multigroup is not required and we have no subgroup of items, |
| 405 |
|
// which is correct. However, we now need to ensure CCK will not fire |
| 406 |
|
// validation errors related to the fields in this multigroup from |
| 407 |
|
// content_multiple_value_nodeapi_validate(). |
| 408 |
|
// To do so, we are creating a private array in the $form_state, and |
| 409 |
|
// that will be available from the $node object processed during |
| 410 |
|
// hook_nodeapi('validate'), which is where CCK enforces field |
| 411 |
|
// requirement for multiple value fields. |
| 412 |
|
foreach (array_keys($group_fields) as $field_name) { |
| 413 |
|
$form_state['values']['_content_ignore_required_fields'][$field_name] = TRUE; |
| 414 |
|
} |
| 415 |
|
} |
| 416 |
} |
} |
| 417 |
} |
} |
| 418 |
} |
} |