From 8d63ed4511ddca227f2e4f5b49cb20431ad69b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Sat, 1 Jun 2024 16:59:48 +0200 Subject: [PATCH] Fix not all related fields populated when adding record from related record list --- .../compose/src/views/Public/Pages/Records/View.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 523a05a2f..ffded5d65 100644 --- a/client/web/compose/src/views/Public/Pages/Records/View.vue +++ b/client/web/compose/src/views/Public/Pages/Records/View.vue @@ -406,11 +406,11 @@ export default { } else { if (this.refRecord) { // Record create form called from a related records block, - // we'll try to find an appropriate field and cross-link this new record to ref - const recRefField = this.module.fields.find(f => f.kind === 'Record' && f.options.moduleID === this.refRecord.moduleID) - if (recRefField) { - this.values[recRefField.name] = this.refRecord.recordID - } + // we'll try to find an appropriate fields and cross-link this new record to ref + + this.module.fields.filter(f => f.kind === 'Record' && f.options.moduleID === this.refRecord.moduleID).forEach(f => { + this.values[f.name] = this.refRecord.recordID + }) } return new compose.Record(module, { values: this.values })