PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/fields/FrmFieldCombo.php +10 -12 6.28 → trunk View file →
@@ -434,21 +434,19 @@
434 434 if ( class_exists( 'FrmProEntryMeta' ) && FrmProEntryMeta::skip_required_validation( $this->field ) ) {
435 435 return $errors;
436 436 }
437 437
438 - if ( class_exists( 'FrmProFieldsHelper' ) && ! FrmProFieldsHelper::is_field_visible_to_user( $this->field ) ) {
439 - return $errors;
440 - }
441 -
442 438 $blank_msg = FrmFieldsHelper::get_error_msg( $this->field, 'blank' );
443 439 $sub_fields = $this->get_processed_sub_fields();
444 440
445 441 // Validate not empty.
446 442 foreach ( $sub_fields as $name => $sub_field ) {
447 - if ( empty( $sub_field['optional'] ) && empty( $args['value'][ $name ] ) ) {
448 - $errors[ 'field' . $args['id'] . '-' . $name ] = '';
449 - $errors[ 'field' . $args['id'] ] = $blank_msg;
443 + if ( ! empty( $sub_field['optional'] ) || ! empty( $args['value'][ $name ] ) ) {
444 + continue;
450 445 }
446 +
447 + $errors[ 'field' . $args['id'] . '-' . $name ] = '';
448 + $errors[ 'field' . $args['id'] ] = $blank_msg;
451 449 }
452 450
453 451 return $errors;
454 452 }
@@ -459,15 +457,15 @@
459 457 * @return array
460 458 */
461 459 public function get_export_headings() {
462 460 $headings = array();
463 - $field_id = $this->field->id ?? $this->field['id'];
464 - $field_name = $this->field->name ?? $this->field['name'];
465 - $field_key = $this->field->field_key ?? $this->field['field_key'];
461 + $field_id = is_object( $this->field ) ? $this->field->id : $this->field['id'];
462 + $field_name = is_object( $this->field ) ? $this->field->name : $this->field['name'];
466 463 $sub_fields = $this->get_processed_sub_fields();
467 464
465 + // Include sub-field headings.
468 466 foreach ( $sub_fields as $name => $sub_field ) {
469 - $headings[ $field_id . '_' . $name ] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label'];
467 + $headings[ $field_id . '_' . $name ] = $field_name . ' - ' . $sub_field['label'];
470 468 }
471 469
472 470 return $headings;
473 471 }
@@ -505,9 +503,9 @@
505 503 * Gets inputs container attributes.
506 504 *
507 505 * @return array
508 506 */
509 - protected function get_inputs_container_attrs() {
507 + public function get_inputs_container_attrs() {
510 508 return array(
511 509 'class' => 'frm_combo_inputs_container',
512 510 'id' => 'frm_combo_inputs_container_' . $this->field_id,
513 511 );