{"record":{"id":"3ca0917a2d06edc0","repo":"siyuan-note/siyuan","slug":"invalid-create-attribute-view-item-documents-save","errorCode":null,"errorMessage":"invalid create attribute view item documents save mode [%s]","messagePattern":"invalid create attribute view item documents save mode \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/attribute_view_new_item.go","lineNumber":327,"sourceCode":"\tlock.Lock()\n\treturn lock.Unlock\n}\n\nfunc attributeViewItemDocumentTemplate(attrView *av.AttributeView, saveMode string) (*av.NewItemTemplate, error) {\n\tswitch saveMode {\n\tcase CreateAttributeViewItemDocsSaveModeSubDoc:\n\t\treturn &av.NewItemTemplate{\n\t\t\tTargetType:   av.NewItemTargetDocument,\n\t\t\tSaveLocation: &av.NewItemSaveLocation{},\n\t\t}, nil\n\tcase CreateAttributeViewItemDocsSaveModeTemplate:\n\t\titemTemplate := attrView.GetNewItemTemplate(attrView.DefaultTemplateID)\n\t\tif nil != itemTemplate && av.NewItemTargetDocument == itemTemplate.TargetType {\n\t\t\treturn itemTemplate, nil\n\t\t}\n\t\treturn &av.NewItemTemplate{TargetType: av.NewItemTargetDocument}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid create attribute view item documents save mode [%s]\", saveMode)\n\t}\n}\n\nfunc resolveAttributeViewNewItemTemplate(blockID string, itemTemplate *av.NewItemTemplate, createdAt time.Time) (*NewItemTemplatePreview, error) {\n\tboxID := \"\"\n\tif blockTree := treenode.GetBlockTree(blockID); blockTree != nil {\n\t\tboxID = blockTree.BoxID\n\t} else {\n\t\tfor _, encBoxID := range treenode.GetOpenedEncryptedBoxIDs() {\n\t\t\tif blockTree := treenode.GetBlockTreeInBox(blockID, encBoxID); blockTree != nil {\n\t\t\t\tboxID = encBoxID\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tprimary, err := RenderGoTemplateAtInBox(itemTemplate.PrimaryKeyTemplate, createdAt, boxID)\n\tif nil != err {\n\t\treturn nil, err","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/attribute_view_new_item.go#L309-L345","documentation":"Error \"invalid create attribute view item documents save mode [%s]\" thrown in siyuan-note/siyuan.","triggerScenarios":"Calling the create-item API with an unrecognized save-mode option for where the new row's document should be stored.","commonSituations":"Occurs when the client passes an unsupported save mode for documents created from an attribute view new-item template.","solutions":["Use a supported save mode value for creating item documents (for example the documented current-notebook or specified-path modes).","Check the API parameter spelling against the attribute view new-item documentation."],"exampleFix":"Pass saveMode with a valid enum value accepted by addAttributeViewItem instead of a custom string.","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-12T23:17:12.415Z"}