Try to fix Duplicate Board.

Thanks to xet7 !

Fixes #4459
This commit is contained in:
Lauri Ojansivu 2022-04-06 17:52:11 +03:00
parent 5744aac7bf
commit e7a11c5733
2 changed files with 4 additions and 2 deletions

View file

@ -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);

View file

@ -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