From f4caa6983ba3fa875da6db75abc11530c0ae57c1 Mon Sep 17 00:00:00 2001 From: mertmit Date: Mon, 5 Aug 2024 19:15:51 +0000 Subject: [PATCH 1/2] fix: properly export looked up attachments --- packages/nocodb/src/helpers/dataHelpers.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/helpers/dataHelpers.ts b/packages/nocodb/src/helpers/dataHelpers.ts index ca24f0b7dc..3bf518f1e1 100644 --- a/packages/nocodb/src/helpers/dataHelpers.ts +++ b/packages/nocodb/src/helpers/dataHelpers.ts @@ -167,16 +167,17 @@ export async function serializeCellValue( } if (!Array.isArray(data)) { - data = undefined; + data = [data]; } } catch { data = undefined; } return (data || []) + .filter((attachment) => attachment) .map( (attachment) => - `${encodeURI(attachment.title)}(${encodeURI( + `${encodeURI(attachment.title || 'Attachment')}(${encodeURI( attachment.signedPath ? `${siteUrl}/${attachment.signedPath}` : attachment.signedUrl, From 98141ff17b26995ad4c1115e77ac56a74da0c4f5 Mon Sep 17 00:00:00 2001 From: mertmit Date: Mon, 5 Aug 2024 19:15:51 +0000 Subject: [PATCH 2/2] fix: avoid encoding attachment title --- packages/nocodb/src/helpers/dataHelpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/helpers/dataHelpers.ts b/packages/nocodb/src/helpers/dataHelpers.ts index 3bf518f1e1..d7163308c2 100644 --- a/packages/nocodb/src/helpers/dataHelpers.ts +++ b/packages/nocodb/src/helpers/dataHelpers.ts @@ -177,7 +177,7 @@ export async function serializeCellValue( .filter((attachment) => attachment) .map( (attachment) => - `${encodeURI(attachment.title || 'Attachment')}(${encodeURI( + `${attachment.title || 'Attachment'}(${encodeURI( attachment.signedPath ? `${siteUrl}/${attachment.signedPath}` : attachment.signedUrl,