Révision 9df8b457
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/webform_validation/webform_validation.module | ||
---|---|---|
152 | 152 |
} |
153 | 153 |
} |
154 | 154 |
|
155 |
// Webform 7.x-3.x does not define WEBFORM_CONDITIONAL_INCLUDE. Define if needed. |
|
156 |
if (!defined('WebformConditionals::componentShown') && !defined('WEBFORM_CONDITIONAL_INCLUDE')) { |
|
157 |
define('WEBFORM_CONDITIONAL_INCLUDE', 1); |
|
158 |
} |
|
159 |
|
|
155 | 160 |
if ($rules) { |
156 | 161 |
$component_definitions = webform_validation_prefix_keys($node->webform['components']); |
157 | 162 |
// Remove hidden components. |
158 | 163 |
foreach ($component_definitions as $key => $component) { |
159 |
if (isset($flat_values[$key]) && _webform_client_form_rule_check($node, $component, 0, $form_state['values']['submitted']) !== WEBFORM_CONDITIONAL_INCLUDE) { |
|
160 |
unset($flat_values[$key]); |
|
164 |
if (defined('WebformConditionals::componentShown')) { |
|
165 |
if (webform_get_conditional_sorter($node)->componentVisibility($component['cid'], $component['page_num']) !== WebformConditionals::componentShown) { |
|
166 |
unset($flat_values[$key]); |
|
167 |
} |
|
168 |
} |
|
169 |
else { |
|
170 |
// Old conditionals system removed in Webform 7.x-4.8. |
|
171 |
// In Webform 7.x-3.x, _webform_client_form_rule_check() returns boolean. |
|
172 |
// Cast to int so that the function behaves as it does in 7.x-4.x. |
|
173 |
if (isset($flat_values[$key]) && (int) _webform_client_form_rule_check($node, $component, 0, $form_state['values']['submitted']) !== WEBFORM_CONDITIONAL_INCLUDE) { |
|
174 |
unset($flat_values[$key]); |
|
175 |
} |
|
161 | 176 |
} |
162 | 177 |
} |
163 | 178 |
foreach ($rules as $rule) { |
Formats disponibles : Unified diff
Weekly update of contrib modules