I receive this notice in the debug log
Function validate was called <strong>incorrectly</strong>. Only arrays should be returned when using the frm_validate_entry filter. Please see <a href="https://wordpress.org/documentation/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 6.3.)
I am using this filter add_filter('frm_validate_field_entry', 'check_mentoremail_update', 10, 3);
but I am returning the array
return $errors;
Is anyone else getting this notice? Is it of any concern?
add_filter('frm_validate_field_entry', 'check_mentoremail_update', 10, 3);
function check_mentoremail_update($errors, $posted_field, $posted_value){
jm_write_log("2.5 snippet");
$mentordemailid = FrmField::get_id_by_key('mentoremail0020');
jm_write_log("2.5 snippet mentordemailid=".strval($mentordemailid));
if($posted_field->id == $mentordemailid) {
if(empty($posted_value)) {
jm_write_log("2.5 snippet posted value is filled");
//$errors['field'. $posted_field->id ] = 'No errors.';
/* email is good*/
} else {
$mentoremail = sanitize_email( $_POST['item_meta'][$mentordemailid]); // the email input field from the form
jm_write_log("Snippet 2.5 mentoremail = ".$mentoremail );
if ( is_email( $mentoremail ) && email_exists( $mentoremail ) ) {
jm_write_log("2.5 snippet email exists");
//$errors['field'. $posted_field->id ] = 'No errors.';
/* email is good*/
} else {
$errors['field'. $posted_field->id ] = 'This email address is not registered, please try another one or leave blank.';
}
}
}
return $errors;
}
I got...nuthin' . The code looks fine to me. If it's returning an object that isn't an array it seems like it was passed in that way. I suggest going through Formidable support or putting some debug code in the Formidable PHP files to see what's happening.
I can't get formidable support to even allow the word "code" in the support request. Do you have some secret sauce on how to get a ticket submitted and a response?
Did you try rewording it, such as "PHP" instead of "code"?
Please login or Register to submit your answer
Post the code for check_mentoremail_update