From 90045b6faa5904ecd4185bf1f3a021f6b3396e74 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Mon, 8 Jan 2018 11:18:36 +0000 Subject: [PATCH] Fix filtering. --- src/filter-component.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/filter-component.js b/src/filter-component.js index ebf1dd0f4..38b1c8afd 100644 --- a/src/filter-component.js +++ b/src/filter-component.js @@ -97,11 +97,12 @@ FilterComponent.prototype._checkFields = }; const self = this; - Object.keys(literal_keys).forEach(function(name) { + for (let n=0; n < Object.keys(literal_keys).length; n++) { + const name = Object.keys(literal_keys)[n]; const match_func = literal_keys[name]; const not_name = "not_" + name; const disallowed_values = self[not_name]; - if (disallowed_values.map(match_func)) { + if (disallowed_values.filter(match_func).length > 0) { return false; } @@ -111,7 +112,7 @@ FilterComponent.prototype._checkFields = return false; } } - }); + } const contains_url_filter = this.filter_json.contains_url; if (contains_url_filter !== undefined) {