{"record":{"id":"dea6c7b2fc19865c","repo":"siyuan-note/siyuan","slug":"invalid-card-field-full-row-value-v","errorCode":null,"errorMessage":"invalid card field full row value [%v]","messagePattern":"invalid card field full row value \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/attribute_view.go","lineNumber":1769,"sourceCode":"\tdefault:\n\t\treturn av.ErrWrongLayoutType\n\t}\n\n\terr = av.SaveAttributeView(attrView)\n\treturn\n}\n\nfunc (tx *Transaction) doSetAttrViewColFullRow(operation *Operation) (ret *TxErr) {\n\tif err := setAttrViewColFullRow(operation); nil != err {\n\t\treturn &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()}\n\t}\n\treturn\n}\n\nfunc setAttrViewColFullRow(operation *Operation) (err error) {\n\tfullRow, ok := operation.Data.(bool)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid card field full row value [%v]\", operation.Data)\n\t}\n\n\tattrView, err := av.ParseAttributeView(operation.AvID)\n\tif err != nil {\n\t\treturn\n\t}\n\tview, err := getAttrViewOperationView(attrView, operation)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfound := false\n\tswitch view.LayoutType {\n\tcase av.LayoutTypeGallery:\n\t\tfor _, field := range view.Gallery.CardFields {\n\t\t\tif field.ID == operation.ID {\n\t\t\t\tfield.FullRow = fullRow\n\t\t\t\tfound = true","sourceCodeStart":1751,"sourceCodeEnd":1787,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/attribute_view.go#L1751-L1787","documentation":"Returned by setAttrViewColFullRow (attribute_view.go:1769), dispatched through the transaction action \"setAttrViewColFullRow\". The handler type-asserts operation.Data to bool; if the assertion fails (Data is not a Go bool — e.g. a string \"true\", a number, or null) it returns this error. A JSON true/false decodes to a Go bool, so the failure indicates a non-boolean payload.","triggerScenarios":"Frontend sends setAttrViewColFullRow with data as a string (\"true\"/\"false\"), a number (1/0), or null instead of a JSON boolean. The fullRow flag controls whether a card field occupies an entire row in gallery/kanban layouts.","commonSituations":"Plugin serializes a boolean as 1/0 or \"true\"; older frontend build sending a stringified value; a generic update helper that wraps all values in strings.","solutions":["Send a real JSON boolean (true/false) in operation.data for this action.","Do not stringify or numericize the flag; the kernel type-asserts to bool, not to a string/number.","If building the operation generically, special-case boolean fields to emit JSON booleans."],"exampleFix":"// before: stringified flag\ntransaction({ op: \"setAttrViewColFullRow\", data: \"true\" })\n\n// after: real boolean\ntransaction({ op: \"setAttrViewColFullRow\", data: true })","handlingStrategy":"type-guard","validationCode":"// Ensure a real JSON boolean, not a string/number/null.\nif (typeof data !== 'boolean') throw new Error('fullRow must be a boolean')","typeGuard":"function isFullRowFlag(v: unknown): v is boolean {\n  return typeof v === 'boolean'\n}","tryCatchPattern":null,"preventionTips":["Emit a JSON boolean (true/false); never stringify or numericize.","Special-case boolean fields in generic operation builders.","Remember Go decodes JSON true/false to bool — any other JSON type fails the assertion."],"tags":["attribute-view","av","gallery","kanban","card","validation","type-assertion","transaction"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}