Raven: Empty file inputs result in form not submitting properly

I have multiple file inputs in my form, like so:

<fieldset>
  <legend>Photo Gallery Images</legend>
  <p>The image selected as primary will be used whenever this business is featured on the website.</p>
  <div>
    <label for="gallery_1">Image 1 (primary):</label>
    <input type="file" name="gallery_1" id="gallery_1" required>
  </div>
  <div>
    <label for="gallery_2">Image 2:</label>
    <input type="file" name="gallery_2" id="gallery_2">
  </div>
  <div>
    <label for="gallery_3">Image 3:</label>
    <input type="file" name="gallery_3" id="gallery_3">
  </div>
</fieldset>

Here's the relevant chunk of my formset:

submission_save_to_file: true
submission_save_path: _content/venues/
submission_save_extension: md
filename_format: "_1.{{ title|slugify }}"
upload_destination: assets/img/gallery/

# Fields allowed to be submitted in the form, automatically purging anything and everything else
allowed:
  - gallery_1
  - gallery_2
  - gallery_3

required:
  - gallery_1

I require gallery_1 but not the others. However, if any are empty... the file(s) will be uploaded to the server, but the form doesn't submit or create a Markdown file. It reloads itself with no error message (or maybe I just don't have one configured - but these fields are optional, after all).

Anything else I can say on this?

Answered by UGA College of Education!
>>>>>>> Answered <<<<<<<
1 Reply
1 Follower