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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | formtweaker.patch | 1.06 KB | trogie |
| #2 | validate_required.patch | 1.15 KB | z.stolar |
Comments
Comment #1
z.stolar commentedPrinting 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?
Comment #2
z.stolar commentedI 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...
Comment #3
z.stolar commentedThere 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
Comment #4
trogie commentedOK, 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.
Comment #5
trogie commentedAUCH!! 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