mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Fix upgrade to 8.08 duplicates lists.
Thanks to xet7 ! Fixes #5962, fixes #5952
This commit is contained in:
parent
82f048ccef
commit
c3a4052227
1 changed files with 16 additions and 8 deletions
|
|
@ -203,7 +203,7 @@ BlazeComponent.extendComponent({
|
||||||
boardId: boardId,
|
boardId: boardId,
|
||||||
swimlaneId: swimlane._id,
|
swimlaneId: swimlane._id,
|
||||||
sort: sharedList.sort || 0,
|
sort: sharedList.sort || 0,
|
||||||
archived: sharedList.archived || false,
|
archived: sharedList.archived || false, // Preserve archived state from original list
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
modifiedAt: new Date()
|
modifiedAt: new Date()
|
||||||
};
|
};
|
||||||
|
|
@ -215,16 +215,24 @@ BlazeComponent.extendComponent({
|
||||||
if (sharedList.wipLimitSoft) newListData.wipLimitSoft = sharedList.wipLimitSoft;
|
if (sharedList.wipLimitSoft) newListData.wipLimitSoft = sharedList.wipLimitSoft;
|
||||||
|
|
||||||
Lists.insert(newListData);
|
Lists.insert(newListData);
|
||||||
|
|
||||||
|
if (process.env.DEBUG === 'true') {
|
||||||
|
const archivedStatus = sharedList.archived ? ' (archived)' : ' (active)';
|
||||||
|
console.log(`Created list "${sharedList.title}"${archivedStatus} for swimlane ${swimlane.title || swimlane._id}`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (process.env.DEBUG === 'true') {
|
||||||
|
console.log(`List "${sharedList.title}" already exists in swimlane ${swimlane.title || swimlane._id}, skipping`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Archive or remove the original shared list
|
// Remove the original shared list completely
|
||||||
Lists.update(sharedList._id, {
|
Lists.remove(sharedList._id);
|
||||||
$set: {
|
|
||||||
archived: true,
|
if (process.env.DEBUG === 'true') {
|
||||||
modifiedAt: new Date()
|
console.log(`Removed shared list "${sharedList.title}"`);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark board as processed
|
// Mark board as processed
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue