Is this Notice of any concern Function validate was called incorrectly. Only arrays should be returned when using the frm_validate_entry filter. Please see Debugging in WordPress for more information. (This message was added in version 6.3.)

By: Jay Mac | Asked: 08/04/2023
ForumsCategory: General questionsIs this Notice of any concern Function validate was called incorrectly. Only arrays should be returned when using the frm_validate_entry filter. Please see Debugging in WordPress for more information. (This message was added in version 6.3.)
Jay Mac asked 2 years ago

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?

Rob LeVineRob LeVine Staff replied 2 years ago

Post the code for check_mentoremail_update

1 Answers
Jay Mac answered 2 years ago

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;
}  

Rob LeVineRob LeVine Staff replied 2 years ago

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.

Jay Mac replied 2 years ago

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?

Rob LeVineRob LeVine Staff replied 2 years ago

Did you try rewording it, such as "PHP" instead of "code"?

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right