mistic100 / mistic100/jQuery-QueryBuilder

getRules on boolean type returns differently when there are more than one operator

Open
#779 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
544
PR merge metrics
No merged PRs in 30d

Description

Hi, I am using filter with boolean type. I realise that 'getRules' doesn't work as expected when there are more than one operator.

The reason why i need two operators (ie. "equal" and "not_equal") because I have integrated your filter with the ability to input a dynamic value from somewhere else.
Thus it would be helpful if I can do
eg.

param_1 = "true"
test: field_1 equal param_1
test: field_1 not_equal param_1

Fiddle below:
Works - One operator, getRules return 1 or 0
https://jsfiddle.net/fh7q3Lz4/7/

Fail - Two operators, getRules return true or false
https://jsfiddle.net/fh7q3Lz4/8/

I have tested with an older version that works (ie. 2.4.3)
https://jsfiddle.net/fh7q3Lz4/9/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the working and failing jsFiddle reproductions, then check the 2.4.3 fiddle to identify how getRules handles boolean filters with one versus multiple operators. Done means getRules returns the expected rule representation for both the single-operator and multi-operator cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.