Fix not all checklist items being imported/cloned

reviewable/pr3389/r1
Daniel Eder 5 years ago
parent fe87b9928c
commit b777f7f2af
  1. 6
      models/wekanCreator.js

@ -716,6 +716,10 @@ export class WekanCreator {
createChecklistItems(wekanChecklistItems) {
wekanChecklistItems.forEach((checklistitem, checklistitemIndex) => {
//Check if the checklist for this item (still) exists
//If a checklist was deleted, but items remain, the import would error out here
//Leading to no further checklist items being imported
if (this.checklists[checklistitem.checklistId]) {
// Create the checklistItem
const checklistItemTocreate = {
title: checklistitem.title,
@ -724,10 +728,12 @@ export class WekanCreator {
sort: checklistitem.sort ? checklistitem.sort : checklistitemIndex,
isFinished: checklistitem.isFinished,
};
const checklistItemId = ChecklistItems.direct.insert(
checklistItemTocreate,
);
this.checklistItems[checklistitem._id] = checklistItemId;
}
});
}

Loading…
Cancel
Save