From 2089d3b0c619bad92fda5d2a540004ae697037d3 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 14 Feb 2025 16:44:11 +0100 Subject: [PATCH] fix: use default value from schema for non inheritable fields Eg. moreControl Co-authored-by: David Larlet --- umap/static/umap/js/modules/form/fields.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/modules/form/fields.js b/umap/static/umap/js/modules/form/fields.js index 7dc6a6d7..9bbef4ec 100644 --- a/umap/static/umap/js/modules/form/fields.js +++ b/umap/static/umap/js/modules/form/fields.js @@ -81,10 +81,14 @@ class BaseElement { } get() { - if (!this.properties.inheritable) return this.builder.getter(this.field) + let value const path = this.field.split('.') const key = path[path.length - 1] - const value = this.obj.getOption(key) + if (!this.properties.inheritable) { + value = this.builder.getter(this.field) + } else { + value = this.obj.getOption(key) + } if (value === undefined) return SCHEMA[key]?.default return value }