libgraviton / php-rql-parser

A PHP RQL Parsing Library
15 stars 4 forks source link

sorting is ignored when combined with lt() #21

Closed hairmare closed 9 years ago

hairmare commented 9 years ago

This is from GRV-1497 and pertains to 2.0.0-alpha1.

Sorting seems to not work in combination with lt(). The following example is how this was reproduced.

lt(id,3),sort(-group)
hairmare commented 9 years ago

still needs retest from my POV

hairmare commented 9 years ago

Tested with http://graviton-develop.nova.scapp.io/core/app?q=lt(order,100)&sort(%2Border) and http://graviton-develop.nova.scapp.io/core/app?q=lt(order,100)&sort(-order)... Still broken, probably an issue with how the AST is being applied to the AST.

This problem probably has to do with the Doctrine\ODM\MongoDB\Query\Expr and maybe even with what is being done to the query builder before and/or after it is being passed into the visitor...

mrix commented 9 years ago

URL http://graviton-develop.nova.scapp.io/core/app?q=lt(order,100)&sort(%2Border) is invalid because "&" (ampersand) is not part of RQL query. It should be http://graviton-develop.nova.scapp.io/core/app?q=lt(order,100)%26sort(%2Border)

mrix commented 9 years ago

Check https://github.com/libgraviton/php-rql-parser/pull/44

hairmare commented 9 years ago

so basically this was pebkac :) Thanks @mrix