In the vocabulary edit page the node types checkboxes are marked as required, so every vocabularies should have at least one node type. When you create a new vocabulary, you get the error message "Types field is required." if you don't select any node type. The problem comes when you edit the vocabulary: if you deselect all node types and press Submit, the vocabulary will be saved without node types. If you edit it again and submit it without node types, you'll get the error message.
In other words, if the vocabulary has node types it's possibile to save it without the node types; if the vocabulary hasn't any node type, it's not possibile to save it again without the node types.
In my opinion the node types shouldn't be a required field, you might need vocabularies for admin purposes without showing them in the node edit form.

Comments

magico’s picture

Still present.

asimmonds’s picture

Status: Active » Needs review
StatusFileSize
new728 bytes

Could adding a taxonomy form _validate to check for a empty node types array be a suitable fix?

AmrMostafa’s picture

+1 for that node types shouldn't be required.
Simply because you can't control that. If you have a vocabulary with type 'foo' selected. User deleted node type 'foo' from admin -> content -> content types, now your vocabulary is nodetype-less.

AmrMostafa’s picture

StatusFileSize
new722 bytes

Patch attached, it removes the #required bit from $form.

Jaza’s picture

I am all for making the 'types' field non-required. It is already non-required in the category module. But my guess is that others may feel it is encouraging hackish use of the taxonomy system (I may be wrong, and I hope I'm wrong, in guessing this):

Dries: Why would you want to exclude certain terms from being shown? Because some modules are abusing the node or taxonomy system to do thing they shouldn't be doing? :)

(from http://drupal.org/node/42466 - about taxonomy terms and adv search)

+1 from me, FWIW.

kkaefer’s picture

Version: x.y.z » 5.x-dev
Status: Needs review » Closed (duplicate)