From e84c910a68c14289f383e3ad000e1aec0ea6b88a Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Mon, 13 Jul 2026 15:13:05 -0600 Subject: [PATCH] Drop `new` from static FieldKey.fromParts call under ES2023 Under the pre-@labkey/api-1.52.0 ES5 target, `FieldKey.fromParts` was compiled to a plain function property, which is [[Construct]]-able, so `new LABKEY.FieldKey.fromParts(...)` worked by convention. Once @labkey/api targets ES2023 (labkey-api-js#219) the class is emitted as a native ES6 class whose static methods are not constructors, so the `new` call throws `TypeError: not a constructor`. The exception unwinds `Ext4.each` before the reader's `readRecords` calls `callParent`, so `idProperty` is never set on the reader and every subsequent update fails the "Record passed as update which lacks keyfield" assertion in EHR data-entry stores. --- LDK/resources/web/LDK/data/LabKeyStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LDK/resources/web/LDK/data/LabKeyStore.js b/LDK/resources/web/LDK/data/LabKeyStore.js index d7dbdfaf..f5829bdb 100644 --- a/LDK/resources/web/LDK/data/LabKeyStore.js +++ b/LDK/resources/web/LDK/data/LabKeyStore.js @@ -53,7 +53,7 @@ Ext4.define('LDK.data.proxy.ExtendedJsonReader', { if (data.metaData){ Ext4.each(data.metaData.fields, function(field){ if (!field.name){ - var fk = new LABKEY.FieldKey.fromParts(field.fieldKey); + var fk = LABKEY.FieldKey.fromParts(field.fieldKey); field.name = fk.toString(); } }, this);