Hi,
Just reporting that the same thing is going on wit this module as with module conditional fields. If a field is made required, it is not enforced after submit.
https://www.drupal.org/node/1372284

Comments

Tobias Xy’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Category: Bug report » Feature request

This is actually a feature request: #2258933: Validation on form submit Drupal's States API doesn't provide any serverside validation, so this is the expected behavior so far.
But this feature could be added in a future version.

dodlhuat’s picture

Damn. Then this module is pretty much useless to me :( I'll try to get a validation up and running by myself.

Tobias Xy’s picture

Status: Active » Closed (won't fix)
SchwebDesign’s picture

Interesting, this was my initially expected intention for this module at least with respect to the required field. If a field will be required, wouldn't you assume it'd also be ultimately required via validation? Shouldn't we reopen this as a bug or at least feature request?

Tobias Xy’s picture

Status: Closed (won't fix) » Active

Yeah, I will work on this one as soon as I find the time for it. So setting it to active again.

SchwebDesign’s picture

Very nice thank you!

suydam’s picture

Just adding my thanks for looking at this, too.

Marking a field required doesn't really help if we cannot enforce it.
So as it stands we still need to code custom validation hook for any field we make required.

hass’s picture

Priority: Normal » Major

The most important feature I need too.

Nikdilis’s picture

Nikdilis’s picture

As I already wrote in the linked post:
There are things that should be considered as pretty much basic (from scratch) when using "powerful" CMS like Drupal - this is definitely one thing! So I consider the validation (enforcement of required fields) to be a part of the states api in drupal. Otherwise the states api is pretty much useless itself. Will this be addressed at least in Drupal 8?

rooby’s picture

This is not the place for questions about states API.
You'll need to open an issue against drupal core for that.

roball’s picture

Title: required is not enforced » Enforce the state "required"

Setting the state required to a field without treating that field to be required is pretty useless. If this is the "expected behaviour" due to Drupal core's States API, then the concept of this module is incomplete.

Tobias Xy, do you have a plan when to find time to look into this?

Nikdilis’s picture

ryan.ryan’s picture

I'm wondering that if required/optional settings aren't actually respected in form validation then maybe the module should not even display them as options.

On one hand, I suppose they exist and sort of help by making a user think something could be required. But, that's not really a solution. Additionally, I suppose you could make something required by using client side validation, but that's implementing something custom and it doesn't help for making fields optional that are initially required.

I'm not saying I have a solution at the moment, but this certainly feels like more than a feature request as it's implicit in the UI.

roball’s picture

Priority: Major » Critical

Sorry about increasing the priority, but without having this fixed, this module is pretty useless.

brpubs’s picture

Has anyone found a solution to making the field actually required?

chowdhuriarijit’s picture

patch is provided in this link https://www.drupal.org/node/2258933

chowdhuriarijit’s picture

Status: Active » Closed (duplicate)
luenemann’s picture