From be7198a875c98a58a8e9d4ecf69e04b131327626 Mon Sep 17 00:00:00 2001 From: Fendy Heryanto Date: Fri, 30 Jan 2026 09:56:44 +0000 Subject: [PATCH] handle empty meta during v3 transform --- packages/nocodb/src/helpers/formulaHelpers.ts | 2 +- .../utils/api-v3-data-transformation.builder.ts | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/nocodb/src/helpers/formulaHelpers.ts b/packages/nocodb/src/helpers/formulaHelpers.ts index 9667229724..b36ffbb830 100644 --- a/packages/nocodb/src/helpers/formulaHelpers.ts +++ b/packages/nocodb/src/helpers/formulaHelpers.ts @@ -38,7 +38,7 @@ export async function getFormulasReferredTheColumn( if (UITypes.Button === c.uidt && (formula as ButtonColumn)?.type !== 'url') return columns; - if (fn(formulaJsep(formula.formula))) { + if (formula.formula && fn(formulaJsep(formula.formula))) { columns.push(c); } return columns; diff --git a/packages/nocodb/src/utils/api-v3-data-transformation.builder.ts b/packages/nocodb/src/utils/api-v3-data-transformation.builder.ts index a2262db071..c2cb3bc146 100644 --- a/packages/nocodb/src/utils/api-v3-data-transformation.builder.ts +++ b/packages/nocodb/src/utils/api-v3-data-transformation.builder.ts @@ -430,8 +430,7 @@ export const columnBuilder = builderGenerator( } if (data.type === UITypes.Checkbox) { - const { icon, iconIdx, ...rest } = data.options as Record; - + const { icon, iconIdx, ...rest } = options; // extract option meta and include only label and color options = rest; @@ -443,7 +442,7 @@ export const columnBuilder = builderGenerator( )?.label; } } else if (data.type === UITypes.Rating) { - const { icon, iconIdx, ...rest } = data.options as Record; + const { icon, iconIdx, ...rest } = options; // extract option meta and include only label and color options = rest; @@ -456,10 +455,7 @@ export const columnBuilder = builderGenerator( )?.label; } } else if (data.type === UITypes.Duration) { - const { duration, duration_format, ...rest } = data.options as Record< - string, - any - >; + const { duration, duration_format, ...rest } = options; const durationFormat = duration ?? duration_format; // extract option meta and include only label and color options = rest; @@ -468,7 +464,7 @@ export const columnBuilder = builderGenerator( options.duration_format = durationOptions[durationFormat]?.title; } } else if (data.type === UITypes.Button) { - const { type, ...rest } = data.options as Record; + const { type, ...rest } = options; // Transform button properties based on type if (type === 'formula') { @@ -514,11 +510,9 @@ export const columnBuilder = builderGenerator( options = { ...rest, button_type: type }; } } else if (isLinksOrLTAR(data.type)) { - const { type, ...rest } = - (data.options as Record) ?? options; + const { type, ...rest } = options; options = { ...rest, relation_type: type }; } - options = options || data.options; // exclude rollup function if Links if (data.type === UITypes.Links && options && options.rollup_function) {