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

Fixed Unexpected 'NUMBER' #880

Merged
merged 1 commit into from
Feb 10, 2021
Merged

Fixed Unexpected 'NUMBER' #880

merged 1 commit into from
Feb 10, 2021

Conversation

MinePlay96
Copy link
Contributor

@MinePlay96 MinePlay96 commented Jun 10, 2020

if you had a query with an "IN" with 10 elements or more, the regex of setRulesFromSQL did not match correctly

Merge request checklist

  • I read the guidelines for contributing
  • I created my branch from dev and I am issuing the PR to dev
  • I didn't pushed the dist directory
  • Unit tests are OK
  • If it's a new feature, I added the necessary unit tests
  • If it's a new language, I filled the __locale and __author fields

if you had a query with an "IN" with 10 elements or more, the regex of setRulesFromSQL did not match correctly
@MinePlay96
Copy link
Contributor Author

Hey, I think there's something wrong with the build logic

@mistic100
Copy link
Owner

@MinePlay96 can you give more details on what case this is supposed to fix ?

Also add or edit the unit tests (although they don't work on the CI).

@MinePlay96
Copy link
Contributor Author

MinePlay96 commented Jun 10, 2020

$('#queryBuilder').queryBuilder('setRulesFromSQL', {
    "sql":"Status IN(:Status_1, :Status_2, :Status_3, :Status_4, :Status_5, :Status_6, :Status_7, :Status_8, :Status_9, :Status_10)",
    "params":{
        "Status_1":1,
        "Status_2":2,
        "Status_3":4,
        "Status_4":5,
        "Status_5":6,
        "Status_6":9,
        "Status_7":10,
        "Status_8":11,
        "Status_9":12,
        "Status_10":13
    }
}, 'named');

which would produce the following regex without my adjustments
/\:(Status_1|Status_2|Status_3|Status_4|Status_5|Status_6|Status_7|Status_8|Status_9|Status_10)/g
This regex would map Status_1 instead of Status_10;.
see: https://regex101.com/r/ln3YoL/1

@mistic100 mistic100 merged commit a5950dd into mistic100:dev Feb 10, 2021
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

Successfully merging this pull request may close these issues.

2 participants