Does anyone else have the same issue?
Required taxonomies are being marked as such (the red asterisk), but even if I don't check any checkbox, the form passes validation without a problem.

CommentFileSizeAuthor
#4 formtweaker.patch1.06 KBtrogie
#2 validate_required.patch1.15 KBz.stolar

Comments

z.stolar’s picture

Printing out the form values during validation, I saw that the form is indeed passing along values, even though no checkbox is actually checked.
What could be causing this?

z.stolar’s picture

Status: Active » Needs review
StatusFileSize
new1.15 KB

I added some validation code in hook_nodeapi.
I'm not sure whether it's the right place, neither am I sure about its quality, but the patch works for me...

z.stolar’s picture

There is one problem to which I didn't find the solution: Not choosing any term in a required taxonomy, is not marking the field in red, to signal the error

trogie’s picture

StatusFileSize
new1.06 KB

OK, I see this problem also with a required category. In my case it's a required, multiple select, single hierarchy category.

This behaviour is caused by the 'default value' that comes from the Drupal form multiselect-array. As a default_value is set, the form gets validated.

My patch unsets the default_value for any category:
-if it's a required, it's my opinion that the category needs to be looked at every time so having a default_value could omit this step.
-if it's not required, it doesn't matter if there's no default value anyway :-)

the patch also removes a line in the 'single select' ( =!multiple select) with a strange setting for default_value: the default_value for radios form needs to be an array.

trogie’s picture

AUCH!! Forget about this last patch as it's only ok for new content and it's not ok resetting the default_value for editing content.

I'll have a look writing something better.

Trogie