Fixed bug where the metadata field type got lost when first loading the edit item metadata page

This commit is contained in:
lotte
2019-04-04 09:38:39 +02:00
parent e2f93a3828
commit b5ab5845a9

View File

@@ -196,7 +196,8 @@ export class RegistryService {
const metadatafieldsObs: Observable<MetadataField[]> = rmrObs.pipe(
map((rmr: RegistryMetadatafieldsResponse) => rmr.metadatafields),
map((metadataFields: MetadataField[]) => metadataFields)
/* Make sure to explicitly cast this into a MetadataField object, on first page loads this object comes from the object cache created by the server and its prototype is unknown */
map((metadataFields: MetadataField[]) => metadataFields.map((metadataField: MetadataField) => Object.assign(new MetadataField(), metadataField)))
);
const pageInfoObs: Observable<PageInfo> = requestEntryObs.pipe(