diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php index 81115a9..12d5c0a 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php @@ -149,22 +149,20 @@ public function massageFormValues(array $values, array $form, FormStateInterface * * @throws \InvalidArgumentException * Thrown when there's no 'auto_create_bundle' set but the entity reference - * is configured to store new terms in multiple vocabularies. + * is configured to store new entities in multiple bundles. */ protected function getAutocreateBundle() { $bundle = NULL; if ($this->getSelectionHandlerSetting('auto_create') && $target_bundles = $this->getSelectionHandlerSetting('target_bundles')) { - // If the 'target_bundles' setting is restricted to a single choice, we - // can use that. + // If there's only one target bundle, use it. if (count($target_bundles) == 1) { $bundle = reset($target_bundles); } - // Otherwise use the target vocabulary stored in selection handler - // settings. + // Otherwise use the target bundle stored in selection handler settings. elseif (!$bundle = $this->getSelectionHandlerSetting('auto_create_bundle')) { - // If no bundle has been set as auto create target vocabulary means that - // there is an inconsistency in entity reference field settings. - throw new \InvalidArgumentException("Reference auto-create is enabled on multiple target vocabularies but 'auto_create_bundle' is not set."); + // If no bundle has been set as auto create target means that there is + // an inconsistency in entity reference field settings. + throw new \InvalidArgumentException("Reference auto-create is enabled on multiple target bundles but 'auto_create_bundle' is not set."); } }