To reproduce: Set up term reference field, select autcomplete_deluxe widget, configure content_taxonomy to deny new taxonomy terms, then add or edit a node with that field. Start typing a term that doesn't exist in the vocabulary.

Experienced behavior: Drop-down box produced by taxonomy_deluxe reads: "The term 'asdf' will be added"

Expected behavior: Drop-down will tell me that the term doesn't exist (and can't be selected).

Attached image shows text in question.

CommentFileSizeAuthor
autocomplete-will-be-added.png10.22 KBezheidtmann

Comments

msypes’s picture

I just hit this problem as well.
I don't have a solution, but here's a work-around that will at least give you similar functionality:

  1. Don't use the autocomplete-deluxe widget; switch to a select list
  2. Install and enable the Chosen module
  3. From that module's configuration page, you can target the select lists using standard selectors

It's working well enough for my purposes, so I thought I'd share

johnv’s picture

IMO this is annoying, but only to resolve if the autocomplete widget knows about the 'deny new term'feature.

OTOH: why is this feature disable for some widgets? I can't find a reason.

function content_taxonomy_autocomplete_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) {
  $field = $form['#field'];
  $instance = $form['#instance'];

+if ($field['type'] == 'taxonomy_term_reference') { 
-  if ($instance['widget']['type'] == 'taxonomy_autocomplete' || $instance['widget']['type'] == 'autocomplete_deluxe_taxonomy') {
ezheidtmann’s picture

Why? Because the vocabulary is large (several hundred terms) but is fixed (a committee created it and regular content editors can't add terms.

If direct support for this condition is not possible (or not recommended), perhaps you can document a way for other modules to override the displayed text. (I'm now using "chosen" for this project, so unfortunately I won't be able to test or provide patches)

anavrin’s picture

Hi there,

I have the same problem :( Anybody could share the fix for this?

i'd be really grateful ...

damienmckenna’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

I wonder if the problem is on Autocomplete Deluxe's side? The "The term 'asdf' will be added" message doesn't exist in Content Taxonomy (fyi I searched for "will be added").