Hi there,

I am unable to save my node when I'm using Field Validation. So for example to be able to publish the node a minimum of 1 field needs to have content out of 5 or so fields. Although the user should be able to save as draft without fillilng these in.

Is someone able to advise on what to do or had the same issue? It seems to be similar to the required fields bug https://drupal.org/node/1786442

Thanks
Gem

Comments

GemVinny’s picture

I have looked in the database to see if it's to do with the weight of the module, but it's not that.. still wondering what the issue might be. It may be something similar to the field required issue.
Gemma

rooby’s picture

Issue summary: View changes

This is a hard one to deal with, because we can't just blindly ignore all validation without possibly causing security holes.

The required field validation was an exception because we know that doesn't introduce a security hole.

Possibly some support could be added for the field validation module to allow you to select which validators are allowed to be skipped when saving drafts.

I will have a bit more of a think about possible solutions.

rooby’s picture

Title: Cannot save draft with Field Validation on the fields » Allow bypassing field validation module validators when saving drafts
Category: Bug report » Feature request

This is technically not a bug, so changing.

Anonymous’s picture

I think that one of the ways of solving this problem, would be to skip validations only for empty fields and validate those that have values entered. Correct me if I am wrong(still a noob), but I think there would be no security issues if we did this.

rooby’s picture

It would be good to have a list of field_validation plugins that would be skipped (the list could be altered by other modules), however I've had a quick look and it looks like it's going to be hard to hook into the field_validation module's validation processes due to the way that they run.

It might require a patch to the field_validation module to make it more feasible.

rooby’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

Here is a patch that skips validation for field_validation module rules.
Currently it skips these 2 types of validators (but it can easily be tweaked to add others):
* Required field
* Require some of several fields

It requires the patch from this issue to be applied to the field_validation module: #2935050: Allow validation rules to be altered before they are applied

rooby’s picture