From e7a11c57338a15a8fc1e1b74a2446ffd7d4743a7 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 6 Apr 2022 17:52:11 +0300 Subject: [PATCH] Try to fix Duplicate Board. Thanks to xet7 ! Fixes #4459 --- client/components/boards/boardsList.js | 2 +- models/cards.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index 467e5686a..7f49df7ab 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -239,7 +239,7 @@ BlazeComponent.extendComponent({ }, (err, res) => { if (err) { - this.setError(err.error); + self.setError(err.error); } else { Session.set('fromBoard', null); subManager.subscribe('board', res, false); diff --git a/models/cards.js b/models/cards.js index 166bbf0cb..5c4fa1762 100644 --- a/models/cards.js +++ b/models/cards.js @@ -4,6 +4,8 @@ import { TYPE_LINKED_BOARD, TYPE_LINKED_CARD, } from '../config/const'; +import Attachments from "./attachments"; + Cards = new Mongo.Collection('cards'); @@ -585,8 +587,8 @@ Cards.helpers({ // Copy attachments oldCard.attachments().forEach(att => { att.cardId = _id; - Attachments.insert(att); delete att._id; + return Attachments.insert(att); }); // copy checklists