{"record":{"id":"72e8a79e5dfe84e1","repo":"siyuan-note/siyuan","slug":"new-item-template-s-not-found","errorCode":null,"errorMessage":"new item template [%s] not found","messagePattern":"new item template \\[(.+?)\\] not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/attribute_view_new_item.go","lineNumber":80,"sourceCode":"type CreateAttributeViewItemDocsResult struct {\n\tItemIDs        []string     `json:\"itemIDs\"`\n\tBlockIDs       []string     `json:\"blockIDs\"`\n\tSkippedItemIDs []string     `json:\"skippedItemIDs,omitempty\"`\n\tWarnings       []string     `json:\"warnings,omitempty\"`\n\tTransaction    *Transaction `json:\"-\"`\n}\n\n// CreateAttributeViewItem 按指定模板创建一个数据库条目。templateID 为空时创建空白游离条目。\nfunc CreateAttributeViewItem(avID, blockID, viewID, templateID, previousID, groupID string) (*CreateAttributeViewItemResult, error) {\n\tattrView, err := av.ParseAttributeView(avID)\n\tif nil != err {\n\t\treturn nil, err\n\t}\n\tcreatedAt := time.Now()\n\titemTemplate := attrView.GetNewItemTemplate(templateID)\n\tvar prunedOptions []*av.PrunedNewItemTemplateOption\n\tif \"\" != templateID && nil == itemTemplate {\n\t\treturn nil, fmt.Errorf(\"new item template [%s] not found\", templateID)\n\t}\n\tif nil == itemTemplate {\n\t\titemTemplate = &av.NewItemTemplate{TargetType: av.NewItemTargetDetached}\n\t} else {\n\t\tcloned := *attrView\n\t\tprunedOptions = cloned.PruneInvalidNewItemTemplateFieldValues()\n\t\tif err = cloned.SetNewItemTemplates(&av.NewItemTemplatesConfig{Templates: []*av.NewItemTemplate{itemTemplate}}); nil != err {\n\t\t\treturn nil, err\n\t\t}\n\t\tattrView = &cloned\n\t\titemTemplate = cloned.NewItemTemplates[0]\n\t}\n\tpreview, err := resolveAttributeViewNewItemTemplate(blockID, itemTemplate, createdAt)\n\tif nil != err {\n\t\treturn nil, err\n\t}\n\tfor _, prunedOption := range prunedOptions {\n\t\tif templateID == prunedOption.TemplateID {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/attribute_view_new_item.go#L62-L98","documentation":"Error \"new item template [%s] not found\" thrown in siyuan-note/siyuan.","triggerScenarios":"Creating an attribute view item from a template whose ID has been deleted or was mistyped.","commonSituations":"Occurs when creating an attribute view row with a new-item template ID that no longer exists, for example after the template was deleted in another view or device.","solutions":["Verify the new item template ID exists in the attribute view's newItemTemplates config before using it.","List available templates via the attribute view config and pick a valid template ID."],"exampleFix":"Open the database's new-item template settings, copy the template id from the existing entries, and pass that id to the create-item call.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}