how to deny new terms from being created?

fyi,i've checked out content taxonomy module (for deny) in conjunction with autocomplete deluxe (single-term), but the latter module doesn't function properly when term contains a comma.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dargente’s picture

also requested Taxonomy Single Tag be added as a widget in Content Taxonomy, but that may take awhile. It would be useful to have an option to deny new terms in this module.

milesw’s picture

Category: Support request » Feature request
Issue summary: View changes
Status: Active » Needs review
FileSize
3.19 KB

This would be a nice feature. The widget works great for very large vocabularies, but sometimes those vocabularies need to be controlled (no autocreate).

Here is a patch that adds a field instance setting to ignore terms submitted by the user when they don't match any existing terms. There is also a setting to display a message to the user when their term is ignored.

milesw’s picture

Screenshot of the field setting:

Field setting screenshot

oleg.medvedev’s picture

Better to use form_error function:

$message = format_string($instance['widget']['settings']['ignore_message'], array('%name' => $tag, '@name' => $tag));
// drupal_set_message($message, 'warning');
form_error($element, $message);

oleg.medvedev’s picture