Title: input file bug when required
Last modified: March 24, 2021

---

# input file bug when required

 *  Resolved [emmanuel31](https://wordpress.org/support/users/emmanuel31/)
 * (@emmanuel31)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/input-file-bug-when-required/)
 * 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)

 *  [ynick](https://wordpress.org/support/users/ynick/)
 * (@ynick)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/input-file-bug-when-required/#post-14247909)
 * 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](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/input-file-bug-when-required/#post-14254499)
 * 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](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/input-file-bug-when-required/#post-14255461)
 * should be fixed in v4.10. Please upgrade and let me know if it works for you.
 *  [ynick](https://wordpress.org/support/users/ynick/)
 * (@ynick)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/input-file-bug-when-required/#post-14257795)
 * Dear Aurovrata, works great now, thank you for the quick fix!
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/input-file-bug-when-required/#post-14257940)
 * great, leave a [review](https://wordpress.org/support/plugin/cf7-grid-layout/reviews/)
   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.

 * ![](https://ps.w.org/cf7-grid-layout/assets/icon-256x256.png?rev=1834229)
 * [Smart Grid-Layout Design for Contact Form 7](https://wordpress.org/plugins/cf7-grid-layout/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-grid-layout/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-grid-layout/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-grid-layout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-grid-layout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-grid-layout/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/input-file-bug-when-required/#post-14257940)
 * Status: resolved