Révision 4f315dab
Ajouté par Assos Assos il y a environ 8 ans
drupal7/sites/all/modules/webform_validation/webform_validation.module | ||
---|---|---|
110 | 110 |
* Webform validation handler to validate against the given rules |
111 | 111 |
*/ |
112 | 112 |
function webform_validation_validate($form, &$form_state) { |
113 |
$static_error_messages = &drupal_static(__FUNCTION__, array()); |
|
113 | 114 |
$page_count = 1; |
114 | 115 |
$nid = $form_state['values']['details']['nid']; |
115 | 116 |
$node = node_load($nid); |
... | ... | |
192 | 193 |
$errors = webform_validation_unprefix_keys($errors); |
193 | 194 |
$components = webform_validation_unprefix_keys($component_definitions); |
194 | 195 |
foreach ($errors as $item_key => $error) { |
196 |
// Do not set error message if an identical message has already been set. |
|
197 |
if (in_array($error, $static_error_messages, TRUE)) { |
|
198 |
continue; |
|
199 |
} |
|
200 |
$static_error_messages[] = $error; |
|
201 |
|
|
195 | 202 |
// build the proper form element error key, taking into account hierarchy |
196 | 203 |
$error_key = 'submitted][' . webform_validation_parent_tree($item_key, $components) . $components[$item_key]['form_key']; |
197 | 204 |
if (is_array($error)) { |
Formats disponibles : Unified diff
Weekly update of contrib modules