siyuan-note/siyuan · error

invalid card field full row value

Error message

invalid card field full row value [%v]

What it means

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.

Solutions

  1. Pass a strict boolean in operation.Data (data.FullRow === true / Boolean(value) from a real checkbox).
  2. Coerce string inputs explicitly (value === "true") before building the operation.
  3. Fix the serializer that is turning booleans into strings or numbers.

Example fix

// before
op.Data = String(checkbox.checked); // "true"
// after
op.Data = checkbox.checked === true;
Defensive patterns

Strategy: type-guard

Validate before calling

if (typeof data !== 'boolean') throw new TypeError('full row value must be a boolean');

Type guard

const isBoolean = (v: unknown): v is boolean => typeof v === 'boolean';

Try / catch

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; }

Prevention

When it happens

Trigger: Sending a setAttrViewColFullRow transaction operation whose Data is a string "true", a number 1/0, or null instead of a real boolean.

Common situations: JavaScript callers serializing booleans as strings; form inputs yielding "on"/"0"; generic plugin code stuffing the checkbox value into Data without coercion.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/dea6c7b2fc19865c. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/attribute_view.go:1915

	default:
		return av.ErrWrongLayoutType
	}

	err = av.SaveAttributeView(attrView)
	return
}

func (tx *Transaction) doSetAttrViewColFullRow(operation *Operation) (ret *TxErr) {
	if err := setAttrViewColFullRow(operation); nil != err {
		return &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()}
	}
	return
}

func setAttrViewColFullRow(operation *Operation) (err error) {
	fullRow, ok := operation.Data.(bool)
	if !ok {
		return fmt.Errorf("invalid card field full row value [%v]", operation.Data)
	}

	attrView, err := av.ParseAttributeView(operation.AvID)
	if err != nil {
		return
	}
	view, err := getAttrViewOperationView(attrView, operation)
	if err != nil {
		return
	}

	found := false
	switch view.LayoutType {
	case av.LayoutTypeGallery:
		for _, field := range view.Gallery.CardFields {
			if field.ID == operation.ID {
				field.FullRow = fullRow
				found = true

View on GitHub (pinned to 9f775e8a12)