Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In fetch criteria, ORs cannot be nested #443

Open
zzmp opened this issue Jan 12, 2015 · 4 comments
Open

In fetch criteria, ORs cannot be nested #443

zzmp opened this issue Jan 12, 2015 · 4 comments

Comments

@zzmp
Copy link

zzmp commented Jan 12, 2015

Example: Fetching mail from a list of addresses, where FROM can be [email protected], [email protected], [email protected].

Entering this as ['OR', ['[email protected]', '[email protected]', '[email protected]']] fails, as OR can only take two arguments.
Entering this as nested OR also fails in parsing it to a criterion string.

Is there another way to include ORed lists?

@Setogit
Copy link

Setogit commented Jan 20, 2015

faced the same issue and implemented a workaround as follows:

@@ -1830,7 +1830,7 @@ function buildSearchQuery(options, extensions, info, isOrChild) {
   var searchargs = '', err, val;
   for (var i = 0, len = options.length; i < len; ++i) {
     var criteria = (isOrChild ? options : options[i]),
-        args = null,
+        args = (isOrChild ? null : options.slice(1)),
         modifier = (isOrChild ? '' : ' ');
     if (typeof criteria === 'string')
       criteria = criteria.toUpperCase();

@Setogit
Copy link

Setogit commented Jan 20, 2015

aha, sorry.

  •    args = (isOrChild ? null : options.slice(I+1)),
    

@zzmp
Copy link
Author

zzmp commented Jan 20, 2015

@Setogit Why not PR this?

@Setogit
Copy link

Setogit commented Jan 21, 2015

Absolutely. Pull requested as make OR filter work #444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants