Skip to content

Commit

Permalink
[FIX] fix cased when there was no source folder to search on
Browse files Browse the repository at this point in the history
  • Loading branch information
benwillig committed Feb 28, 2024
1 parent 4ed1e37 commit 7bda52e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cmis_web/static/src/cmis_document/cmis_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);

0 comments on commit 7bda52e

Please sign in to comment.