diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-10-13 23:51:54 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-10-13 23:51:54 +0300 |
commit | 8cd5f7c185d31849c12ec0d9188120a6cb3e361e (patch) | |
tree | dc451421cb3e307d2f15a76d5b8d54008ba18dbd /models | |
parent | bedd3767cece1784c9622b5c9d17d61251ba61e1 (diff) | |
download | wekan-8cd5f7c185d31849c12ec0d9188120a6cb3e361e.tar.gz wekan-8cd5f7c185d31849c12ec0d9188120a6cb3e361e.tar.bz2 wekan-8cd5f7c185d31849c12ec0d9188120a6cb3e361e.zip |
- [Fix deleting Custom Fields, removing broken references](https://github.com/wekan/wekan/issues/1872).
Thanks to Akuket and Clement87 !
Diffstat (limited to 'models')
-rw-r--r-- | models/customFields.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/customFields.js b/models/customFields.js index 6c5fe7c4..38481d8c 100644 --- a/models/customFields.js +++ b/models/customFields.js @@ -71,6 +71,12 @@ if (Meteor.isServer) { Activities.remove({ customFieldId: doc._id, }); + + Cards.update( + {'boardId': doc.boardId, 'customFields._id': doc._id}, + {$pull: {'customFields': {'_id': doc._id}}}, + {multi: true} + ); }); } |