From 6bd7f4051148eece4e367ba750c2e09862d80fe1 Mon Sep 17 00:00:00 2001 From: Daniel Eder <1525711+daniel-eder@users.noreply.github.com> Date: Thu, 17 Dec 2020 11:10:30 +0200 Subject: [PATCH] Treat unknown attachment types as binary on board import/clone Fixes missing attachments and even missing --- models/wekanCreator.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/models/wekanCreator.js b/models/wekanCreator.js index 9ae34b7ef..514a9d095 100644 --- a/models/wekanCreator.js +++ b/models/wekanCreator.js @@ -474,6 +474,12 @@ export class WekanCreator { } }); } else if (att.file) { + //If attribute type is null or empty string is set, assume binary stream + att.type = + !att.type || att.type.trim().length === 0 + ? 'application/octet-stream' + : att.type; + file.attachData( Buffer.from(att.file, 'base64'), {