From 6da10ca4ae8be46ac3419506397f14bd225fe602 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 29 Oct 2021 17:50:59 +0200 Subject: [PATCH] fix(ui): cast empty strings to null --- public/scripts/services/form.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/scripts/services/form.js b/public/scripts/services/form.js index c00f0ba5e5..809fd6c57d 100644 --- a/public/scripts/services/form.js +++ b/public/scripts/services/form.js @@ -24,6 +24,9 @@ break; case 'string': value = value.toString(); + if (value.length === 0) { + value = null; + } break; case 'json': value = (value) ? JSON.parse(value) : []; @@ -111,7 +114,7 @@ json[name] = element.value; } } - + json[name] = cast(json[name], castTo); // Apply casting } }