Skip to content

Commit e84c910

Browse files
committed
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.
1 parent d8122a3 commit e84c910

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

LDK/resources/web/LDK/data/LabKeyStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Ext4.define('LDK.data.proxy.ExtendedJsonReader', {
5353
if (data.metaData){
5454
Ext4.each(data.metaData.fields, function(field){
5555
if (!field.name){
56-
var fk = new LABKEY.FieldKey.fromParts(field.fieldKey);
56+
var fk = LABKEY.FieldKey.fromParts(field.fieldKey);
5757
field.name = fk.toString();
5858
}
5959
}, this);

0 commit comments

Comments
 (0)