diff options
author | Ignatz <computer-freak94@gmx.de> | 2018-06-14 12:41:16 +0200 |
---|---|---|
committer | Ignatz <computer-freak94@gmx.de> | 2018-06-14 12:41:16 +0200 |
commit | 571f55f904a9d37dec5895472439dbeadc5b82b2 (patch) | |
tree | e09285fcf5517d2b8a7d3d8673e3a2b94f099905 /models/cards.js | |
parent | 259614b647c72773675541d3de8d0ff73006c299 (diff) | |
download | wekan-571f55f904a9d37dec5895472439dbeadc5b82b2.tar.gz wekan-571f55f904a9d37dec5895472439dbeadc5b82b2.tar.bz2 wekan-571f55f904a9d37dec5895472439dbeadc5b82b2.zip |
fixing search for dropdown fields, and error on loading board
Diffstat (limited to 'models/cards.js')
-rw-r--r-- | models/cards.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/models/cards.js b/models/cards.js index 484e442a..00ec14c2 100644 --- a/models/cards.js +++ b/models/cards.js @@ -230,16 +230,16 @@ Cards.helpers({ // match right definition to each field if (!this.customFields) return []; return this.customFields.map((customField) => { - var definition = definitions.find((definition) => { + const definition = definitions.find((definition) => { return definition._id === customField._id; }); //search for "True Value" which is for DropDowns other then the Value (which is the id) - var trueValue = customField.value; - if (definition.settings.dropdownItems.length > 0) + let trueValue = customField.value; + if (definition.settings.dropdownItems && definition.settings.dropdownItems.length > 0) { - for (var i = 0; i < definition.settings.dropdownItems.length;i++) + for (let i = 0; i < definition.settings.dropdownItems.length; i++) { - if (definition.settings.dropdownItems[i]._id == customField.value) + if (definition.settings.dropdownItems[i]._id === customField.value) { trueValue = definition.settings.dropdownItems[i].name; } |