There was an error while loading. Please reload this page.
1 parent 0592bf8 commit 1ebd1aaCopy full SHA for 1ebd1aa
1 file changed
invenio_communities/assets/semantic-ui/js/invenio_communities/settings/profile/CustomFieldSerializer.js
@@ -52,9 +52,9 @@ export class CustomFieldSerializer {
52
if (isVocabulary && value?.id) {
53
return value.id;
54
}
55
- // Add __key if i is passed i.e is an array. This is needed because of ArrayField
56
- // internal implementation
57
- if (i) value.__key = i;
+ // only assign __key when we're iterating an array (Number.isInteger(i)) and the element is a plain object (not a string or other primitive).
+ if (Number.isInteger(i) && typeof value === "object" && value !== null)
+ value.__key = i;
58
return value;
59
};
60
const _record = _cloneDeep(record);
0 commit comments