{"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":"error","filePath":"kernel/model/attribute_view.go","lineNumber":1915,"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":1897,"sourceCodeEnd":1933,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/attribute_view.go#L1897-L1933","documentation":"setAttrViewColFullRow expects operation.Data to be a Go bool; any other type (string, float, nil, map) fails the type assertion and produces this error. The full-row flag for a card field is strictly boolean.","triggerScenarios":"Sending a setAttrViewColFullRow transaction operation whose Data is a string \"true\", a number 1/0, or null instead of a real boolean.","commonSituations":"JavaScript callers serializing booleans as strings; form inputs yielding \"on\"/\"0\"; generic plugin code stuffing the checkbox value into Data without coercion.","solutions":["Pass a strict boolean in operation.Data (data.FullRow === true / Boolean(value) from a real checkbox).","Coerce string inputs explicitly (value === \"true\") before building the operation.","Fix the serializer that is turning booleans into strings or numbers."],"exampleFix":"// before\nop.Data = String(checkbox.checked); // \"true\"\n// after\nop.Data = checkbox.checked === true;","handlingStrategy":"type-guard","validationCode":"if (typeof data !== 'boolean') throw new TypeError('full row value must be a boolean');","typeGuard":"const isBoolean = (v: unknown): v is boolean => typeof v === 'boolean';","tryCatchPattern":"try { await setColFullRow(avID, viewID, fieldID, data); } catch (e) { if (String(e).includes('invalid card field full row value')) { await setColFullRow(avID, viewID, fieldID, data === 'true' || data === 1); } else throw e; }","preventionTips":["Never serialize booleans as strings into operation.Data","Coerce checkbox/form input to a strict boolean at the boundary","Type-check operation payloads before enqueueing transactions"],"tags":["attribute-view","type-mismatch","validation"],"backgroundTag":"type-mismatch","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}