Skip to content

Grid/list columns offer a sort header on formula fields, which the server refuses as of framework#6994 #3950

Description

@os-zhuang

Filed from framework#6994's implementation. Recorded, not claimed.

What changes underneath

framework#6994 makes the list path refuse an orderBy naming a formula field: 400 INVALID_SORT. Until now that sort was silently dropped — the server answered 200 with every row present in arbitrary order (asc and desc byte-identical, measured on a real SqlDriver), because a formula field is virtual: no driver materialises a column for it, so the ORDER BY reached the driver, found nothing, and the unknown-column backstop retried without it.

So the sort never worked. What changes is that it now says so.

Where that lands in this repo

ObjectGrid disables the sort affordance only for reference-bearing types:

packages/plugin-grid/src/ObjectGrid.tsx:1771

return isExpandableFieldType(fieldDef) ? { ...col, sortable: false } : col;

and isExpandableFieldType (packages/core/src/utils/expand-fields.ts:42) covers lookup / master_detail / tree / user only. formula is not in that set, so a formula column keeps a clickable sort header.

Net effect after framework#6994 lands: clicking that header used to do nothing visible; now it surfaces a 400 INVALID_SORT. Both are wrong for the same underlying reason — the UI is offering a sort the platform cannot perform.

The real fix

sortable: false for columns whose field type materialises no column — formula today. The reference-type carve-out above is the same shape of decision and the natural place for it; this is a second reason a column is unsortable, not a different mechanism.

Not verified by me (framework seat, read-only pass over this repo): whether RelatedList and the other data-table renderers derive sortable through the same path or each decide it separately, and whether any list view metadata in the corpus actually renders a formula column today. Both are worth checking before choosing where the predicate lives.

Refs: framework#6994 (the server-side refusal), framework#6924 (the dotted-path hint that names the same trap), framework#3821 (the backstop that swallowed it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions