diff --git a/cmis_web/static/src/cmis_document/cmis_document.js b/cmis_web/static/src/cmis_document/cmis_document.js index c59a9410..e248a79f 100644 --- a/cmis_web/static/src/cmis_document/cmis_document.js +++ b/cmis_web/static/src/cmis_document/cmis_document.js @@ -181,7 +181,11 @@ export class CmisDocumentField extends CmisSessionComponent { getSrcFolderIdentifiers() { const linkDocumentSrcFolders = this.props.linkDocumentSrcFolders; - return JSON.parse(this.props.record.data[linkDocumentSrcFolders]); + let folders = []; + if (linkDocumentSrcFolders) { + folders = JSON.parse(this.props.record.data[linkDocumentSrcFolders]); + } + return folders; } renameObject(cmisObject) { @@ -273,10 +277,14 @@ CmisDocumentField.props = { }; CmisDocumentField.extractProps = ({field, attrs}) => { - return { + let res = { backend: field.backend, - linkDocumentSrcFolders: attrs.options.linkDocumentSrcFolders, - }; + } + let linkDocumentSrcFolders = attrs.options.linkDocumentSrcFolders + if (linkDocumentSrcFolders) { + res["linkDocumentSrcFolders"] = linkDocumentSrcFolders; + } + return res; }; registry.category("fields").add("cmis_document", CmisDocumentField);