Situation:

1) Contact form with a file field that is required and only accepts PDF
2) Uploading a file with another extension

Result

2 error messages :

- The specified file flag_vietnam.png could not be uploaded.
Only files with the following extensions are allowed: pdf doc dox pcs pages odt indd.

- This value should not be null.

See screenshot.

Where is the error message "This value should not be null" is comming from? Is this a setting wrong in my contact form?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

michiellucas created an issue. See original summary.

Dinesh18’s picture

I have tried creating a new field in Contact Form (/admin/structure/contact). I have created a new Contact Form and added a new field with type "File." I am not able to replicate the issue "This value should not be null." It is throwing an error :

The specified file Hello.feature could not be uploaded.
Only files with the following extensions are allowed: txt.

We can add extensions in that particular field type.

SpadXIII’s picture

Status: Active » Closed (duplicate)
Related issues: +#2482783: File upload errors not set or shown correctly

This seems to be getting fixed in: https://www.drupal.org/node/2482783