File, image, and other compound fields are flagged for violating required validation even when filled

Created on 13 January 2021, about 4 years ago
Updated 3 October 2023, over 1 year ago

Problem

I have an image field that is dependent on a checkbox field. The dependent field is required when the checkbox is checked. But even when the image is uploaded, I am getting an error that the image field is empty.

Steps to reproduce

  • Create a checkbox field
  • Create an image field
  • Make image field required when the checkbox is checked
  • Create a new content and check the checkbox
  • Browse image in the image field
  • Save the content and you will get an error that the image field is required.
🐛 Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

🇮🇳India simar.java Chandigarh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇮Finland thatguy

    I had issues with File field conditions and fixed them with this patch but it only applies for file fields. This issue would need more attention.

  • 🇺🇸United States chrisolof

    Attached is a patch against the current 4.x branch that brings in support for compound fields of type managed_file and phone_number.

    I look at this patch as a temporary fix, but not what we'd want to merge into this module. I still think the constraint route outlined above in #7 is the way to go as it would bring in support for nearly all compound fields and potentially reduce this module's codebase at the same time.

  • 🇮🇳India JatinGupta40

    Hello,
    Even though I have added the video, it shows the required error.
    For v4.0.0-alpha5 this issue is not coming to me but I upgraded it to v4.0.0-alpha6 and got this same error.

Production build 0.71.5 2024