-
-
\ No newline at end of file
diff --git a/src/classes/metadata-types/taxonomy/TaxonomyCheckbox.vue b/src/classes/metadata-types/taxonomy/TaxonomyCheckbox.vue
index 2f709bce8..ffb53a8f8 100644
--- a/src/classes/metadata-types/taxonomy/TaxonomyCheckbox.vue
+++ b/src/classes/metadata-types/taxonomy/TaxonomyCheckbox.vue
@@ -3,7 +3,7 @@
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/src/classes/metadata-types/taxonomy/TaxonomyTaginput.vue b/src/classes/metadata-types/taxonomy/TaxonomyTaginput.vue
index 05a654d77..b3cc69d70 100644
--- a/src/classes/metadata-types/taxonomy/TaxonomyTaginput.vue
+++ b/src/classes/metadata-types/taxonomy/TaxonomyTaginput.vue
@@ -1,6 +1,7 @@
0){
+ if (this.value && this.value.length > 0){
this.selected = this.value;
}
},
@@ -85,13 +84,11 @@
}).then((res) => {
this.termList = res.terms;
- for(let term of this.termList){
+ for (let term of this.termList)
this.labels.push({label: term.name, value: term.id});
- }
- if(this.termList.length <= 0 && this.allowSelectToCreate){
+ if (this.termList.length <= 0 && this.allowSelectToCreate)
this.labels.push({label: `${value} (${this.$i18n.get('select_to_create')})`, value: value})
- }
this.isFetching = false;
}).catch((error) => {
@@ -102,9 +99,8 @@
updateSelectedValues(){
let selected = [];
- for( let term of this.value){
+ for( let term of this.value)
selected.push({label: term.label, value: term.value})
- }
this.selected = selected;
},
@@ -112,25 +108,21 @@
let val = this.selected;
let results = [];
- if (val.length > 0){
- for( let term of val ){
+ if (val.length > 0) {
+ for (let term of val)
results.push( term.value );
- }
-
+
this.$emit('input', results);
- this.$emit('blur');
}
},
emitRemove(){
let val = this.selected;
let results = [];
- for( let term of val ){
- results.push( term.value );
- }
+ for (let term of val)
+ results.push(term.value);
this.$emit('input', results);
- this.$emit('blur');
}
}
}
diff --git a/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php b/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php
index d7785de94..7468506cd 100644
--- a/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php
+++ b/src/classes/metadata-types/taxonomy/class-tainacan-taxonomy.php
@@ -184,6 +184,7 @@ class Taxonomy extends Metadata_Type {
// TODO term_exists is not fully reliable. Use $terms_repository->term_exists. see issue #159
if (!term_exists($term)) {
$valid = false;
+ $this->add_error(__('term not found.', 'tainacan'));
break;
}
}
diff --git a/src/classes/metadata-types/text/Text.vue b/src/classes/metadata-types/text/Text.vue
index f03aad54b..57a5e9ecf 100644
--- a/src/classes/metadata-types/text/Text.vue
+++ b/src/classes/metadata-types/text/Text.vue
@@ -1,21 +1,16 @@