From 35a304fd0ae2ee35495ecef0587dc83595a2f73f Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Mon, 14 Jun 2021 14:32:25 -0400 Subject: [PATCH] Fixed issue that would prevent the m2o from working on foreign keys with no meta row (#6263) * Fix m2o reading from optional value Fixes #6207 * Use optional chaining --- .../interfaces/select-dropdown-m2o/select-dropdown-m2o.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/interfaces/select-dropdown-m2o/select-dropdown-m2o.vue b/app/src/interfaces/select-dropdown-m2o/select-dropdown-m2o.vue index 1a98fc15fa..51a1f73376 100644 --- a/app/src/interfaces/select-dropdown-m2o/select-dropdown-m2o.vue +++ b/app/src/interfaces/select-dropdown-m2o/select-dropdown-m2o.vue @@ -71,7 +71,7 @@ :collection="relatedCollection.collection" :primary-key="currentPrimaryKey" :edits="edits" - :circular-field="relation.meta.one_field" + :circular-field="relation.meta?.one_field" @input="stageEdits" /> @@ -325,7 +325,7 @@ export default defineComponent({ }); const relatedCollection = computed(() => { - return collectionsStore.getCollection(relation.value.related_collection)!; + return collectionsStore.getCollection(relation.value.related_collection!)!; }); const { primaryKeyField: relatedPrimaryKeyField } = useCollection(relatedCollection.value.collection);