By user1774549

2013-01-31 10:36:59 8 Comments

I have a "term reference" field, in a form that uses an auto-complete widget. I want to limit user input to terms in the vocabulary only, and output a message when a user tries to enter a non existing term.

I found the Content taxonomy module. However this does not work with forms that contain a field collection or a field group.

There is also a contributed patch 1078878-DisableAutoCreation-D7-UTF-8.patch. But I was wondering whether there was a simpler/cleaner solution like a module or maybe I missed an already existing way of doing it with latest drupal and taxonomy versions.


@amitgoyal 2013-11-07 08:05:45

There seem to be two possible solutions which are mentioned here and you have also mentioned them in your question.

Excerpt from the post,

There are in fact two solutions. One is the Content Taxonomy module. However, I didn’t feel like installing yet another module for such a simple thing. The second solution is patching the core taxonomy module:

A kind soul on the Drupal forum, j.stuyts, posted a small patch that adds an option to disallow autocreation. All you need to do is download the patch (1078878-DisableAutoCreation-D7-UTF-8.patch) to the Drupal 7 root directory and run.

If you then go to Structure » Content types » [Your content type] and edit a Term reference field that uses the Autocomplete term widget, you’ll see a new option at the bottom: “Allow autocreation of new terms” (checked by default).

Although hacking in core is never recommended but you can use patch till the time you get better solution.

@Mołot 2013-11-07 08:08:57

Hello. The link you provided may answer the question, but if the linked site goes down, your answer will get worthless. Could you post a real answer, not just a link to one?

@amitgoyal 2013-11-07 08:25:09

Thanks for the suggestion @Molot. I have added the excerpt from the post in my answer.

@Елин Й. 2013-01-31 10:48:05

There is already an issue created about the problem with field collection module, and it should have been fixed in dev version of the Content Taxonomy module. Please try the latest dev version and if the problem persists, you can re-open and follow the issue at:

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] Better tagging / taxonomy reference widget

1 Answered Questions

[SOLVED] Loading term references into a custom module

1 Answered Questions

[SOLVED] How to set a content type tile base on taxonomy field that user select?

  • 2015-03-12 23:23:54
  • itsdarrylnorris
  • 186 View
  • 0 Score
  • 1 Answer
  • Tags:   taxonomy-terms

1 Answered Questions

Display taxonomy term description when mouse hovers

1 Answered Questions

Associate a Taxonomy term to user who creates it

2 Answered Questions

1 Answered Questions

Sponsored Content