{"record":{"id":"d607ebf1329c8024","repo":"siyuan-note/siyuan","slug":"conf-language-375","errorCode":null,"errorMessage":"Conf.Language(375)","messagePattern":"Conf\\.Language\\(375\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/shortcuts.go","lineNumber":58,"sourceCode":"\nfunc MoveLocalShorthands(boxID string) (retIDs []string, err error) {\n\tshorthandsDir := filepath.Join(util.ShortcutsPath, \"shorthands\")\n\tif !gulu.File.IsDir(shorthandsDir) {\n\t\treturn\n\t}\n\tif !syncLock.TryLock() {\n\t\terr = errors.New(Conf.Language(222))\n\t\treturn\n\t}\n\tdefer syncLock.Unlock()\n\n\tentries, err := os.ReadDir(shorthandsDir)\n\tif nil != err {\n\t\tlogging.LogErrorf(\"read dir [%s] failed: %s\", shorthandsDir, err)\n\t\treturn\n\t}\n\tif !IsShorthandSaveBoxAvailable(boxID) {\n\t\terr = errors.New(Conf.Language(375))\n\t\treturn\n\t}\n\n\tassetsDir := filepath.Join(util.DataDir, \"assets\")\n\tfor _, entry := range entries {\n\t\tif entry.IsDir() && \"assets\" == entry.Name() {\n\t\t\tassetsEntries, readErr := os.ReadDir(filepath.Join(shorthandsDir, entry.Name()))\n\t\t\tif nil != readErr {\n\t\t\t\tlogging.LogErrorf(\"read dir [%s] failed: %s\", shorthandsDir, readErr)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, assetEntry := range assetsEntries {\n\t\t\t\tif assetEntry.IsDir() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tp := filepath.Join(shorthandsDir, entry.Name(), assetEntry.Name())\n\t\t\t\tassetWritePath := filepath.Join(assetsDir, assetEntry.Name())","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/shortcuts.go#L40-L76","documentation":"MoveLocalShorthands moves shorthand files into the notebook specified by boxID, but first validates the target box via IsShorthandSaveBoxAvailable. If the box is unavailable (missing/closed notebook, encrypted box that cannot accept shorthands, or invalid ID) it aborts with the localized message Conf.Language(375) (\"The specified notebook is unavailable\").","triggerScenarios":"Calling MoveLocalShorthands(boxID) where boxID does not refer to an open, writable notebook — e.g. the notebook configured as the shorthand save target was deleted, closed, or its ID changed after re-creation.","commonSituations":"User deleted or closed the notebook that was set as the shorthand save location; workspace moved between machines so box IDs no longer match; calling the API with a hard-coded boxID from an old configuration.","solutions":["Pass a boxID of an existing open notebook (list via /api/notebook/lsNotebooks) before calling","Re-select the shorthand save notebook in Settings - Collect - Shorthand so the configuration points to a valid box","Create/reopen the missing notebook, then retry MoveLocalShorthands"],"exampleFix":"// before\nMoveLocalShorthands(\"20240101120000-abc1234\") // notebook deleted\n// after\nif IsShorthandSaveBoxAvailable(boxID) {\n    MoveLocalShorthands(boxID)\n} else {\n    boxID = pickFirstOpenNotebook()\n    MoveLocalShorthands(boxID)\n}","handlingStrategy":"validation","validationCode":"// Go: confirm the box exists and is usable before moving\nif !IsShorthandSaveBoxAvailable(boxID) {\n    return fmt.Errorf(\"box %s unavailable for shorthands\", boxID)\n}","typeGuard":"func shorthandBoxOK(boxID string) bool { return IsShorthandSaveBoxAvailable(boxID) }","tryCatchPattern":"if err := MoveLocalShorthands(boxID); err != nil {\n    if err.Error() == Conf.Language(375) {\n        boxID = pickAvailableNotebook() // choose a valid notebook and retry\n    }\n}","preventionTips":["Validate the configured shorthand save notebook on workspace startup","Re-point shorthand settings after deleting/recreating notebooks","List open notebooks and pick from that list instead of hard-coding box IDs"],"tags":["shorthands","notebook","invalid-box-id"],"backgroundTag":"entity-not-found","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}