I have created two new validation rules that I hope work for everyone. I initially created a separate module and put that in my website, but I thought these would be handy for others if they pass scrutiny.

The new rules:

  1. Max filesize for an uploaded file - You can limit the size of a file and stop the before it gets uploaded to the server. This is for file fields only.
  2. Require at least one of several fields - Expanded - This allows checking a file field as well as the other text fields when making one of a group of two or more fields required. I originally had created modified versions of both "oneortwo" and "oneorseveral", but ultimately the modified "oneorseveral" did the job of both if you added a custom error response for the 2 field scenario.

Note: This is my first Drupal patch submission for a module. Hope it works out.

Comments

aubjr_drupal’s picture

I just realized that you can also set a max file size when you're editing the file component, so I guess that validation rule is a little bit of duplication. At least it's in the same place as the other validation rules... I probably should've notated the error message to say that, "This is from Webform Validation," so people can find the source of the error in the configuration.

svendecabooter’s picture

Thanks a lot for your patch.
Would it be trouble to separate the two rules into two patches? If too much trouble, i'll figure it out.
It's just easier in case one could be accepted as is, while the other still needs work...

svendecabooter’s picture

Status: Active » Needs review

BTW i'll try to look into them ASAP but still flooded with work and no end in immediate sight :).
Some user testing & feedback would help speed this process.

aubjr_drupal’s picture

Would it be trouble to separate the two rules into two patches?

Not at all. They are attached here. Feel free to change them as you see fit (error text, comments, etc.)

jscheel’s picture

Thank you, thank you, thank you!!! One of several extended has definitely been great for me!

liam morland’s picture

Version: 6.x-1.4 » 7.x-1.x-dev
Status: Needs review » Needs work

Please provide these as separate patches rolled against the D7 dev version. Please put the file size one in #1182868: Validation rule for File Size?.

liam morland’s picture

Title: I've created two new validation rules for your consideration » someofseveral should work with file
Assigned: Unassigned » liam morland
Issue summary: View changes
Status: Needs work » Active

Use case: Submit your story in a textbox or submitted file.

  • Liam Morland committed 96ba6b5 on 7.x-1.x
    Issue #1197284: Allow someofseveral to work with file.
    
liam morland’s picture

Assigned: liam morland » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.