Skip to content

Order logic does not work with multi-digit conditions #16

@TrangOul

Description

@TrangOul

The following query works as expected:

new QueryBuilder(Account.class)
	.addField(Account.Name)
	
	.addConditions()
	.add(new QueryBuilder.SimpleCondition('Name = \'acc1\''))
	.add(new QueryBuilder.SimpleCondition('Name = \'acc2\''))
	.add(new QueryBuilder.SimpleCondition('Name = \'acc3\''))
	.add(new QueryBuilder.SimpleCondition('Name = \'acc4\''))
	(...)
	.add(new QueryBuilder.SimpleCondition('Name = \'acc12\''))
	.setConditionOrder('1 OR 2 OR 12')
	.preview();
Name = 'acc1' OR Name = 'acc2' OR Name = 'acc12'

, but if we change the order:

	.setConditionOrder('12 OR 1 OR 2')

, the query gets malformed:

Name = 'acc1'Name = 'acc2' OR 1 OR 2

, since 12 is replaced by {1}{2} in bracketConditions (and the subsequent 1 and 2 are left unbracketed ).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions