From 2a8682c234b933fbc37a0433379b462653d54fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Tue, 15 Oct 2024 12:45:22 +0200 Subject: [PATCH] Fix record list ref field handling when no record --- .../compose/src/components/PageBlocks/RecordListBase.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/web/compose/src/components/PageBlocks/RecordListBase.vue b/client/web/compose/src/components/PageBlocks/RecordListBase.vue index 58b8ae51d..e51386da6 100644 --- a/client/web/compose/src/components/PageBlocks/RecordListBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordListBase.vue @@ -1258,8 +1258,8 @@ export default { const r = new compose.Record(this.recordListModule, {}) // Set record values that should be prefilled - if (this.record.recordID && this.options.refField) { - r.values[this.options.refField] = this.record.recordID + if ((this.record || {}).recordID && this.options.refField) { + r.values[this.options.refField] = (this.record || {}).recordID } this.items.unshift(this.wrapRecord(r)) @@ -1380,7 +1380,7 @@ export default { filter.push(`(${pf})`) } - if (refField && this.record.recordID) { + if (refField && (this.record || {}).recordID) { filter.push(`(${refField} = ${this.record.recordID})`) }