diff --git a/src/classes/entities/class-tainacan-item-metadata-entity.php b/src/classes/entities/class-tainacan-item-metadata-entity.php index a7e489062..d88008c3b 100644 --- a/src/classes/entities/class-tainacan-item-metadata-entity.php +++ b/src/classes/entities/class-tainacan-item-metadata-entity.php @@ -487,7 +487,7 @@ class Item_Metadata_Entity extends Entity { if ($this->is_multiple()) { if (is_array($value)) { $cardinality = $metadatum->get_cardinality(); - if ( !empty($cardinality) && $cardinality > 0 && count($value) > $cardinality ) { + if ( !empty($cardinality) && $cardinality > 1 && count($value) > $cardinality ) { $this->add_error( 'invalid', sprintf( __('Metadatum %s is set to accept a maximum of %s values.', 'tainacan'), $metadatum->get_name(), $cardinality ) ); return false; } diff --git a/src/views/admin/components/edition/metadatum-edition-form.vue b/src/views/admin/components/edition/metadatum-edition-form.vue index a1d465695..733307214 100644 --- a/src/views/admin/components/edition/metadatum-edition-form.vue +++ b/src/views/admin/components/edition/metadatum-edition-form.vue @@ -365,10 +365,7 @@ }, watch: { showCardinalityOptions() { - if (!this.showCardinalityOptions) - this.editForm.cardinality = 2; - else - this.editForm.cardinality = 1; + this.editForm.cardinality = !this.showCardinalityOptions ? 1 : 2; } }, created() {