{"record":{"id":"983e44647739391e","repo":"siyuan-note/siyuan","slug":"please-specify-the-daily-note-save-path-in-the-not","errorCode":null,"errorMessage":"Please specify the daily note save path in the Notebook Settings","messagePattern":"Please specify the daily note save path in the Notebook Settings","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/file.go","lineNumber":1422,"sourceCode":"const (\n\tDailyNoteAttrPrefix = \"custom-dailynote-\"\n\tNodeAttrTitleEmpty  = \"custom-sy-title-empty\"\n\tDocHiddenAttr       = \"custom-hidden\"\n)\n\nfunc CreateDailyNote(boxID string) (p string, existed bool, err error) {\n\tcreateDocLock.Lock()\n\tdefer createDocLock.Unlock()\n\n\tbox := Conf.Box(boxID)\n\tif nil == box {\n\t\terr = ErrBoxNotFound\n\t\treturn\n\t}\n\n\tboxConf := box.GetConf()\n\tif \"\" == boxConf.DailyNoteSavePath || \"/\" == boxConf.DailyNoteSavePath {\n\t\terr = errors.New(Conf.Language(49))\n\t\treturn\n\t}\n\n\thPath, err := RenderGoTemplateInBox(boxConf.DailyNoteSavePath, box.ID)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tFlushTxQueue()\n\n\thPath = util.TrimSpaceInPath(hPath)\n\texistRoot := treenode.GetBlockTreeRootByHPath(box.ID, hPath)\n\tif nil != existRoot {\n\t\texisted = true\n\t\tp = existRoot.Path\n\n\t\ttree, loadErr := LoadTreeByBlockID(existRoot.RootID)\n\t\tif nil != loadErr {","sourceCodeStart":1404,"sourceCodeEnd":1440,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/file.go#L1404-L1440","documentation":"Thrown by CreateDailyNote when the notebook's box configuration has no DailyNoteSavePath set (empty string or literal '/'). Conf.Language(49) = 'Please specify the daily note save path in the Notebook Settings'. Daily notes require a Go-template path (e.g., '/Daily Notes/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}') to know where to create the note; without it, the function cannot proceed.","triggerScenarios":"Calling CreateDailyNote(boxID) on a notebook whose boxConf.DailyNoteSavePath is unset. This happens for newly created notebooks that haven't been configured, or notebooks imported from templates that don't include a daily-note path.","commonSituations":"A new notebook is created and the user immediately presses the daily-note shortcut without configuring the save path. A notebook was imported/migrated and the daily note setting was lost. The user is on a fresh workspace and hasn't set up notebook preferences yet.","solutions":["Open Notebook Settings for the target notebook and set the Daily Note Save Path template.","Set a default daily note save path programmatically via the notebook configuration API before calling CreateDailyNote.","In UI flows, detect an empty DailyNoteSavePath and prompt the user to configure it before attempting creation.","For programmatic callers, pre-validate boxConf.DailyNoteSavePath and show a configuration dialog if empty."],"exampleFix":"// before\np, existed, err := model.CreateDailyNote(boxID)\n\n// after\nbox := conf.Box(boxID)\nif box != nil {\n    bc := box.GetConf()\n    if bc.DailyNoteSavePath == \"\" || bc.DailyNoteSavePath == \"/\" {\n        return \"\", false, errors.New(\"configure daily note save path first\")\n    }\n}\np, existed, err := model.CreateDailyNote(boxID)","handlingStrategy":"validation","validationCode":"// Pre-check: ensure daily note save path is configured\nbox := conf.Box(boxID)\nif box == nil {\n    return \"\", false, errors.New(\"notebook not found\")\n}\nbc := box.GetConf()\nif bc.DailyNoteSavePath == \"\" || bc.DailyNoteSavePath == \"/\" {\n    return \"\", false, errors.New(\"configure daily note save path in notebook settings\")\n}","typeGuard":"func hasDailyNotePath(boxID string) bool {\n    box := conf.Box(boxID)\n    if box == nil {\n        return false\n    }\n    bc := box.GetConf()\n    return bc.DailyNoteSavePath != \"\" && bc.DailyNoteSavePath != \"/\"\n}","tryCatchPattern":null,"preventionTips":["Check boxConf.DailyNoteSavePath before calling CreateDailyNote.","Configure the daily note save path as part of notebook creation workflows.","In UI code, detect the missing path and prompt the user to configure it."],"tags":["daily-note","configuration","notebook","validation"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}