From 2e619ae99509336e47ea9b5936f4558c00a1142c Mon Sep 17 00:00:00 2001 From: Denis Baranov Date: Fri, 2 Mar 2018 17:35:42 +0200 Subject: [PATCH] - fixed required field "image". Does not work check, if you delete the previously uploaded image when you update the profile again --- includes/core/um-actions-form.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index d38c1a1a..b7d85eb1 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -269,12 +269,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; if ( isset( $args[$key] ) ) { if ( isset( $array['required'] ) && $array['required'] == 1 ) { - if ( ! isset( $args[$key] ) || $args[$key] == '' ) { - if( empty( $array['label'] ) ) { - UM()->form()->add_error($key, __('This field is required','ultimate-member') ); - } else { - UM()->form()->add_error($key, sprintf( __('%s is required','ultimate-member'), $array['label'] ) ); - } + if ( ! isset( $args[$key] ) || $args[$key] == '' || $args[$key] == 'empty_file') { + if( empty( $array['label'] ) ) { + UM()->form()->add_error($key, __('This field is required','ultimate-member') ); + } else { + UM()->form()->add_error($key, sprintf( __('%s is required','ultimate-member'), $array['label'] ) ); + } } }