• Resolved emmanuel31

    (@emmanuel31)


    Hello

    with cf7 5.4 and cf7 grid layout 4.9.2 activated

    Leaving the required file upload field blank generates the following table as input to the wpcf7_flat_join () function in the /plugins/contact-form-7/includes/functions.php file
    bellow my test
    array(13) {
    [0]=>
    string(8) “10.0.0.7”
    [1]=>
    int(36928)
    [2]=>
    string(20) “wpcf7-f1982-p1978-o1”
    [3]=>
    string(8) “aaaaaaaa”
    [4]=>
    string(12) “bbbbbbbbbbbb”
    [5]=>
    string(11) “ccccccccccc”
    [6]=>
    string(10) “dddddddddd”
    [7]=>
    string(12) “eeeeeeeeeeee”
    [8]=>
    string(11) “ux-designer”
    [9]=>
    string(0) “”
    [10]=>
    string(13) “fffffffffffff”
    [11]=>
    string(1) “1”
    [12]=>
    object(WP_Error)#9756 (3) {
    [“errors”]=>
    array(1) {
    [“wpcf7_invalid_required”]=>
    array(1) {
    [0]=>
    string(25) “Ce champ est obligatoire.”
    }
    }
    [“error_data”]=>
    array(0) {
    }
    [“additional_data”:protected]=>
    array(0) {
    }
    }
    }`
    and the function is ko on the processing of array[12]=>
    and the ajax call generates an error 500

Viewing 5 replies - 1 through 5 (of 5 total)
  • I also get an error when a required file field is left empty.
    The message in the PHP logs is:
    PHP Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in /mnt/web406/e3/72/59949272/htdocs/wefnexus.org/wp-content/plugins/contact-form-7/includes/functions.php:63
    Doing some debugging, the WP_Error it is trying to convert is “The field is required.” Seems like the validation message for file fields is passed as an WP_Error object instead of a string.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    oh no! Sorry for this, kind of silly bug. Didn’t get time to test it fully.

    Will fix and release an update shortly.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    should be fixed in v4.10. Please upgrade and let me know if it works for you.

    Dear Aurovrata, works great now, thank you for the quick fix!

    Plugin Author Aurovrata Venet

    (@aurovrata)

    great, leave a review when you have moment to spare.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘input file bug when required’ is closed to new replies.