fix: preserve colOptions on metadata-only PATCH for SingleSelect/MultiSelect by veeceey · Pull Request #13052 · nocodb/nocodb · GitHub
Skip to content

fix: preserve colOptions on metadata-only PATCH for SingleSelect/MultiSelect#13052

Merged
fendy3002 merged 2 commits intonocodb:developfrom
veeceey:fix/issue-13044-patch-singleselect-coloptions
Feb 20, 2026
Merged

fix: preserve colOptions on metadata-only PATCH for SingleSelect/MultiSelect#13052
fendy3002 merged 2 commits intonocodb:developfrom
veeceey:fix/issue-13044-patch-singleselect-coloptions

Conversation

@veeceey
Copy link
Copy Markdown
Contributor

@veeceey veeceey commented Feb 14, 2026

Fixes #13044

Problem

When sending a PATCH request that only updates metadata fields (like description or title) on a SingleSelect/MultiSelect column without including colOptions, the existing dropdown options get lost.

This happens because the SingleSelect/MultiSelect code path in columnUpdate checks colBody.colOptions?.options to decide whether to process the options block. When colOptions isn't provided, the entire block is skipped -- which means either:

  • The metadata update is silently dropped (no Column.update or updateMetaAndDatabase call happens)
  • In certain flows, Column.update deletes the existing options but doesn't re-insert them since there are none in colBody

This is the same class of bug that was fixed for cdf in #12974.

Fix

After calling getColumnPropsFromUIDT, check if colBody.colOptions?.options is missing but the existing column has options. If so, carry over the existing options to colBody. This way the full update flow proceeds normally, the options are preserved, and metadata-only changes (description, title, etc.) are actually applied.

Reproduction

# Create a SingleSelect column with options, then:
curl -X PATCH \
  'https://<nocodb>/api/v2/meta/columns/<column_id>' \
  -H 'xc-token: <token>' \
  -H 'Content-Type: application/json' \
  -d '{"description": "some description"}'

# Before fix: colOptions wiped / description update silently dropped
# After fix: colOptions preserved, description updated

…iSelect columns

When a PATCH request updates only metadata fields (e.g. description,
title) on a SingleSelect or MultiSelect column without including
colOptions in the request body, the existing dropdown options should be
preserved.

Previously, the options-processing block was skipped entirely when
colOptions was not provided, which either silently dropped the metadata
update or -- in certain code paths through Column.update -- caused the
existing options to be deleted and not re-created.

This fix populates colBody.colOptions from the existing column's
colOptions when the request doesn't include them, ensuring the full
update flow proceeds normally while preserving the dropdown options.

Fixes nocodb#13044
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 14, 2026

@veeceey
Copy link
Copy Markdown
Contributor Author

veeceey commented Feb 16, 2026

@fendy3002 fendy3002 merged commit 4951d9d into nocodb:develop Feb 20, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug: PATCH on SingleSelect column wipes colOptions even for metadata-only updates

3 participants