Skip to content

Commit 4d688f3

Browse files
PaoloPiaAJIXuMuK
authored andcommitted
Finalized fixes for DynamicForm and Document Sets
1 parent 6248271 commit 4d688f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/controls/dynamicForm/DynamicForm.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,11 @@ export class DynamicForm extends React.Component<IDynamicFormProps, IDynamicForm
262262

263263
const library = await sp.web.lists.getById(listId);
264264
const folderTitle = (objects[titleField] !== undefined && objects[titleField] !== '') ?
265-
encodeURIComponent(objects[titleField]) : ''; // Empty string will be replaced by SPO with Folder Item ID
265+
(objects[titleField] as string).replace(/["|*|:|<|>|?|/|\\||]/g, "_") : // Replace not allowed chars in folder name
266+
''; // Empty string will be replaced by SPO with Folder Item ID
266267
const newFolder = await library.rootFolder.addSubFolderUsingPath(folderTitle);
267268
const fields = await newFolder.listItemAllFields();
268-
if (fields[idField] !== undefined) {
269+
if (fields[idField]) {
269270

270271
// Read the ID of the just created folder or Document Set
271272
const folderId = fields[idField];

0 commit comments

Comments
 (0)