From 2d618712f3ed065185932c72774c412b1440013c Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Wed, 4 Aug 2021 14:21:14 -0300 Subject: [PATCH] Fixes undefined term value on inital term of item submssion form. --- src/views/admin/components/metadata-types/taxonomy/Taxonomy.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/admin/components/metadata-types/taxonomy/Taxonomy.vue b/src/views/admin/components/metadata-types/taxonomy/Taxonomy.vue index 56264f4b6..660834294 100644 --- a/src/views/admin/components/metadata-types/taxonomy/Taxonomy.vue +++ b/src/views/admin/components/metadata-types/taxonomy/Taxonomy.vue @@ -145,7 +145,7 @@ getTermsId() { let values = []; if (this.value && this.itemMetadatum.metadatum && this.getComponent != 'tainacan-taxonomy-tag-input') { - values = this.value.map(term => term.id) + values = this.value.map(term => term.id).filter(term => term !== undefined); this.valueComponent = (values.length >= 0 && this.itemMetadatum.metadatum && this.itemMetadatum.metadatum.multiple === 'no') ? values[0] : values; } else if (this.value && this.itemMetadatum.metadatum && this.getComponent == 'tainacan-taxonomy-tag-input') { values = this.value.map((term) => { return { label: term.name, value: term.id } });