The attached patch removes a bunch of PHP notices when editing content type settings and nodes.

It changes the logic in the hook_form_alter() implementation: In the node_type_form case $type is never set and $vocabs will contain all available vocabularies and not just the vocabularies related to the current content type, i.e. all vocabularies on the site will be displayed on the content type edit form. Also, it cleans up *_node_form and removes unnecessary objects in select list options.

CommentFileSizeAuthor
primary_term.form_alter.patch9.03 KBwulff

Comments

brianV’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rmjiv’s picture

Status: Closed (fixed) » Needs work

This is super late, but I disagree with some of the changes of the patch. This is *not* simply a transparent code clean up patch, it makes behavioral changes. Here are some that I've identified this far:

  • Inserts form field even when no terms are selectable. See #1117574: Empty Primary Term form field. To me, this is a bug.
  • Removes default "None" option when field is required. Default item then becomes first element in the list. This is not optimal user interface. A user should be required to select an option and get an error message if they have not.

I'm not sure if the preferred method of addressing these changes is creating new issues or a comprehensive patch on this issue. So I'm going to create issues for things that I consider bugs (#1117574: Empty Primary Term form field) and then eventually attach a complete patch reverting undesired changes on this ticket.