diff --git a/client/web/compose/src/mixins/record.js b/client/web/compose/src/mixins/record.js index afa97c02e5..b4f7f66a3a 100644 --- a/client/web/compose/src/mixins/record.js +++ b/client/web/compose/src/mixins/record.js @@ -175,11 +175,11 @@ export default { moduleID: this.module.moduleID, notPageID: this.page.pageID, }) - } else { - this.$router.push({ name: route, params: { ...this.$route.params, recordID: record.recordID } }) } - if (!isNew) { + if (isNew) { + this.$router.push({ name: route, params: { ...this.$route.params, recordID: record.recordID } }) + } else { this.record = record // reset the record initial state in cases where the record edit page is opened on a modal this.initialRecordState = this.record.clone() diff --git a/client/web/compose/src/views/Public/Pages/Records/View.vue b/client/web/compose/src/views/Public/Pages/Records/View.vue index d93da5eecd..e88d592afd 100644 --- a/client/web/compose/src/views/Public/Pages/Records/View.vue +++ b/client/web/compose/src/views/Public/Pages/Records/View.vue @@ -303,13 +303,10 @@ export default { watch: { recordID: { immediate: true, - handler () { + handler (o, n) { this.record = undefined this.initialRecordState = undefined this.refresh() - this.loadRecord().then(() => { - this.determineLayout() - }) }, }, @@ -524,7 +521,7 @@ export default { layout: undefined, isView: !this.inEditing && !this.inCreating, isCreate: this.inCreating, - isEdit: this.inEditing, + isEdit: this.inEditing && !this.inCreating, ...variables, } @@ -546,8 +543,6 @@ export default { }, async determineLayout (pageLayoutID, variables = {}) { - pageLayoutID = pageLayoutID || (this.layout || {}).pageLayoutID - // Clear stored records so they can be refetched with latest values this.clearRecordSet() let expressions = {}