siyuan-note/siyuan · error

field [%s] not found in view [%s]

Error message

field [%s] not found in view [%s]

What it means

Returned by setAttrViewColFullRow (attribute_view.go:1803) after iterating the gallery (view.Gallery.CardFields) or kanban (view.Kanban.Fields) field list without finding a field whose ID equals operation.ID. The fullRow flag could not be set because the targeted field (column) is absent from the resolved view. The view itself was resolved successfully via getAttrViewOperationView.

Source

Thrown at kernel/model/attribute_view.go:1803

			if field.ID == operation.ID {
				field.FullRow = fullRow
				found = true
				break
			}
		}
	case av.LayoutTypeKanban:
		for _, field := range view.Kanban.Fields {
			if field.ID == operation.ID {
				field.FullRow = fullRow
				found = true
				break
			}
		}
	default:
		return av.ErrWrongLayoutType
	}
	if !found {
		return fmt.Errorf("field [%s] not found in view [%s]", operation.ID, view.ID)
	}

	err = av.SaveAttributeView(attrView)
	return
}

func getAttrViewOperationView(attrView *av.AttributeView, operation *Operation) (ret *av.View, err error) {
	if "" != operation.ViewID {
		ret = attrView.GetView(operation.ViewID)
		if nil == ret {
			err = av.ErrViewNotFound
		}
		return
	}
	return getAttrViewViewByBlockID(attrView, operation.BlockID)
}

func getAttrViewOperationNumber(operation *Operation) (ret float64, err error) {

View on GitHub (pinned to 251596fc0d)

Solutions

  1. Refresh the view's field list before submitting and use a current field ID.
  2. Confirm operation.ID is a field ID from the same view resolved by the operation (operation.ViewID or operation.BlockID), not from a sibling view.
  3. If the field was deleted intentionally, drop the operation rather than retrying.

Example fix

// before: reusing a cached field id
transaction({ op: "setAttrViewColFullRow", id: cachedFieldID, data: true })

// after: resolve the field id from the live view
const view = await fetchAttrViewView(avID, viewID)
const field = view.fields.find(f => f.id === wantedKeyID)
if (!field) return
transaction({ op: "setAttrViewColFullRow", id: field.id, data: true })
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the field ID exists in the resolved view before toggling fullRow.
const view = await fetchAttrViewView(avID, viewID)
if (!view.fields.some(f => f.id === operationID)) {
  throw new Error(`field ${operationID} not found in view ${viewID}`)
}

Type guard

function fieldInView(view: AVView, fieldID: string): boolean {
  return view.fields.some(f => f.id === fieldID)
}

Prevention

When it happens

Trigger: Calling setAttrViewColFullRow with an operation.ID (field/key ID) that does not exist in the current view's field collection — the field was deleted, belongs to a different view, or the ID is stale. Duplicated/renamed fields where the old ID lingers in the UI produce this.

Common situations: Field removed from the view but the UI still references the old ID; plugin hard-codes a field ID; layout was switched (table <-> gallery <-> kanban) and the field list was rebuilt with new IDs; mirror view whose fields diverged from the canonical av.

Related errors


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/87bf1c083781d9b5. Report an issue: GitHub.