Projet

Général

Profil

Révision 4f315dab

Ajouté par Assos Assos il y a environ 8 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/webform_validation/webform_validation.admin.inc
213 213
    '#default_value' => (isset($rule['components'])) ? array_keys($rule['components']) : array(),
214 214
  );
215 215

  
216
  if (isset($rule_validator['custom_data']) && is_array($rule_validator['custom_data'])) {
216
  if (!empty($rule_validator['custom_data']) && is_array($rule_validator['custom_data'])) {
217 217
    $required = isset($rule_validator['custom_data']['required']) ? $rule_validator['custom_data']['required'] : TRUE;
218 218
    $form['rule']['data'] = array(
219 219
      '#type' => 'textfield',
220 220
      '#title' => $rule_validator['custom_data']['label'],
221 221
      '#description' => $rule_validator['custom_data']['description'],
222
      '#required' => ($required !== FALSE) ? TRUE : FALSE,
222
      '#required' => (bool) $required,
223 223
      '#size' => 60,
224 224
      '#maxlength' => NULL,
225 225
      '#default_value' => $rule['data'],
......
227 227
    );
228 228
  }
229 229

  
230
  if (isset($rule_validator['negatable'])) {
230
  if (!empty($rule_validator['negatable'])) {
231 231
    $form['rule']['negate'] = array(
232 232
      '#type' => 'checkbox',
233 233
      '#title' => t('Negate rule'),
......
237 237
    );
238 238
  }
239 239

  
240
  if (isset($rule_validator['custom_error'])) {
240
  if (!empty($rule_validator['custom_error'])) {
241 241
    $form['rule']['error_message'] = array(
242 242
      '#type' => 'textfield',
243 243
      '#title' => t('Custom error message'),
244 244
      '#description' => t("Specify an error message that should be displayed when user input doesn't pass validation"),
245 245
      '#required' => TRUE,
246 246
      '#size' => 60,
247
      '#maxlength' => 255,
247
      '#maxlength' => 2048,
248 248
      '#default_value' => $rule['error_message'],
249 249
      '#weight' => 5,
250 250
    );

Formats disponibles : Unified diff