Users can create new entity references even though I say no. Am I doing it wrong or is this an issue?

by Leraa   Last Updated December 19, 2017 16:07 PM

I'm using Webform version 8.x-5.0-beta24.

I've created an entity reference autocomplete field for users to fill out. After selecting the Type of Item to Reference as "Taxonomy" and naming which vocabulary to use, I left the checkbox empty for "Create referenced entities if they don't already exist" because I do NOT want users to be able to add new terms to the vocabulary.

Screenshot of GUI for the field

However, testing shows that the user CAN enter any keyword desired and the text is entered as a new term in the vocabulary.

Here's how it looks in YAML:

    '#target_type': taxonomy_term
'#selection_handler': 'default:taxonomy_term'
'#selection_settings':
  target_bundles:
    taxonomy_keyword: taxonomy_keyword
  sort:
    field: name
    direction: ASC
  auto_create: 0
  auto_create_bundle: taxonomy_keyword

I can see that autocreate is set to null in the source code, but it still lists what bundle to add new terms to. If I delete that last line, the bundle name, the user can no longer add new terms. However, that desired and expected result is only temporary. Upon re-saving the form, the bundle name is added back into source automatically, and the user can once again create new vocabulary terms.

Am I doing something wrong or is this a legitimate issue that I should create over at the Webform project?

Tags : webform


Related Questions


Webform Rules - Create a Drupal User

Updated November 24, 2017 14:07 PM


Hide webform after the user's first submission

Updated May 16, 2017 17:07 PM

How to get instant result after submitting webform?

Updated September 14, 2017 12:07 PM