diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-09-23 08:10:48 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-09-23 08:10:48 +0300 |
commit | 5f697eac0559710a68da11ebf85fca3ea5ca9a66 (patch) | |
tree | 07643e016b2a74d22cb48db902a6d8ec6846c08d | |
parent | 43a58c92ac3862668ef87d20fe7b09470e26cf66 (diff) | |
parent | e97c2c7bf0ab3213d0ac060af474367effe68af7 (diff) | |
download | wekan-5f697eac0559710a68da11ebf85fca3ea5ca9a66.tar.gz wekan-5f697eac0559710a68da11ebf85fca3ea5ca9a66.tar.bz2 wekan-5f697eac0559710a68da11ebf85fca3ea5ca9a66.zip |
Merge branch 'GhassenRjab-hotfix/sort-checklists-items' into devel
Fix: Checklist items are lost when moving items to
another checklist. Thanks to GhassenRjab ! Related #876
-rw-r--r-- | CHANGELOG.md | 8 | ||||
-rw-r--r-- | server/migrations.js | 26 |
2 files changed, 33 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d59528b..2c7add5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,15 @@ # Upcoming Wekan release +This release adds the following new features: + * [Add translations (en/de/fi) for email notifications regarding checklists and checklist items](https://github.com/wekan/wekan/pull/1238). -Thanks to GitHub users umbertooo and xet7 for their contributions. +and fixes the following bugs: + +* [Checklist items are lost when moving items to another checklist](https://github.com/wekan/wekan/pull/1240). + +Thanks to GitHub users GhassenRjab, umbertooo and xet7 for their contributions. # v0.39 2017-09-18 Wekan release diff --git a/server/migrations.js b/server/migrations.js index 99125976..40420e8e 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -130,3 +130,29 @@ Migrations.add('add-member-isactive-field', () => { Boards.update(board._id, {$set: {members: newMemberSet}}, noValidate); }); }); + +Migrations.add('add-sort-checklists', () => { + Checklists.find().forEach((checklist, index) => { + if (!checklist.hasOwnProperty('sort')) { + Checklists.direct.update( + checklist._id, + { + $set: { + sort: index, + newItemIndex: checklist.items.length, + }, + }, + noValidate + ); + } + checklist.items.forEach(function(item, index) { + if (!item.hasOwnProperty('sort')) { + Checklists.direct.update( + { _id: checklist._id, 'items._id': item._id }, + { $set: { 'items.$.sort': index } }, + noValidate + ); + } + }); + }); +}); |