{"record":{"id":"67a142ff58be5a3a","repo":"siyuan-note/siyuan","slug":"conf-language-118","errorCode":null,"errorMessage":"Conf.Language(118)","messagePattern":"Conf\\.Language\\(118\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/file.go","lineNumber":1745,"sourceCode":"\t\t}\n\t}\n\n\tif 1 == len(fromPaths) {\n\t\t// 移动到自己的父文档下的情况相当于不移动，直接返回\n\t\tif fromBox := pathsBoxes[fromPaths[0]]; nil != fromBox && fromBox.ID == toBoxID {\n\t\t\tparentDir := path.Dir(fromPaths[0])\n\t\t\tif (\"/\" == toPath && \"/\" == parentDir) || (parentDir+\".sy\" == toPath) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\t// 检查路径深度是否超过限制\n\tfor _, fromPath := range fromPaths {\n\t\tfromBox := pathsBoxes[fromPath]\n\t\tchildDepth := util.GetChildDocDepth(filepath.Join(util.DataDir, fromBox.ID, fromPath))\n\t\tif depth := strings.Count(toPath, \"/\") + childDepth; 6 < depth && !Conf.FileTree.AllowCreateDeeper {\n\t\t\terr = errors.New(Conf.Language(118))\n\t\t\treturn\n\t\t}\n\t}\n\n\t// 禁止跨加密边界移动文档：加密笔记本是孤岛，不同加密笔记本各有独立 DEK，\n\t// 跨边界移动（普通↔加密、加密 A↔加密 B）会导致密文用错 DEK 损坏数据\n\tfor _, fromPath := range fromPaths {\n\t\tfromBox := pathsBoxes[fromPath]\n\t\tif fromBox.ID != toBox.ID && !IsSameCryptoBoundary(fromBox.ID, toBox.ID) {\n\t\t\terr = errors.New(Conf.Language(391))\n\t\t\treturn\n\t\t}\n\t}\n\n\t// A progress layer appears when moving more than 64 documents at once https://github.com/siyuan-note/siyuan/issues/9356\n\tsubDocsCount := 0\n\tfor _, fromPath := range fromPaths {\n\t\tfromBox := pathsBoxes[fromPath]","sourceCodeStart":1727,"sourceCodeEnd":1763,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/file.go#L1727-L1763","documentation":"MoveDocs enforces the file-tree depth limit: resulting path depth (target slash count plus the moved subtree's own depth) may not exceed 6 levels unless 'Allow create deeper documents' is enabled (key 118). It is a settings-driven pre-check that fails before any file is touched.","triggerScenarios":"moveDocs where strings.Count(toPath,'/') + childDepth > 6 and Conf.FileTree.AllowCreateDeeper is false.","commonSituations":"Moving deep subtrees into already-nested folders; importing outlines with many nesting levels; users unaware the depth cap is enabled by default.","solutions":["Enable Settings - File Tree - 'Allow create deeper documents' (AllowCreateDeeper)","Move the subtree to a shallower target path","Split or flatten the source hierarchy before moving"],"exampleFix":"// before\nawait fetchPost('/api/filetree/moveDocs', {fromPaths: deepPaths, toNotebook: boxID, toPath: '/a/b/c/d/e'})\n// after\nconst depth = toPath.split('/').length - 1 + childDepth\nif (depth > 6 && !allowCreateDeeper) { /* flatten or enable setting */ }\nawait fetchPost('/api/filetree/moveDocs', {fromPaths: deepPaths, toNotebook: boxID, toPath: '/a/b'})","handlingStrategy":"validation","validationCode":"const depth = toPath.split('/').length - 1 + childDepth(fromPaths); if (depth > 6 && !conf.fileTree.allowCreateDeeper) throw new Error('Move would exceed depth limit')","typeGuard":null,"tryCatchPattern":"try { await fetchPost('/api/filetree/moveDocs', args) } catch (e) { if (String(e).includes('7 levels deep')) { /* flatten or enable AllowCreateDeeper */ } }","preventionTips":["Know the current AllowCreateDeeper setting before deep moves","Keep the tree within 6 levels when automation is involved","Prefer shallow targets for deep subtrees"],"tags":["move","depth-limit","configuration"],"backgroundTag":"value-out-of-range","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}