studiomado / query-bundle

Query doctrine database from query string and provide HATEOAS responses.
MIT License
13 stars 5 forks source link

Sorting on 2nd level embedded it crashes #151

Closed gherardobertini closed 6 years ago

gherardobertini commented 6 years ago
Q A
Bug report? yes
Feature request? no
QueryBundle version 2.2.16-RC17

Sorting on 2nd level embedded it crashes

?sorting[_embedded.customer.macrocategory.descrizione_macrocatyegory]=asc

Instead filtering with the same field it works ?filtering[_embedded.customer.macrocategory.descrizione_macrocatyegory|contains]=aaa

ERROR

{"code":500,"message":"[Semantical Error] line 0, col 234 near 'macrocategory': Error: Class GammaBundle\\Entity\\Macrocategory has no field or association named macrocategory"}

LOG

[2018-06-14 09:46:50] request.CRITICAL: Uncaught PHP Exception Doctrine\ORM\Query\QueryException: "[Semantical Error] line 0, col 234 near 'macrocategory': Error: Class GammaBundle\Entity\Macrocategory has no field or association named macrocategory" at /home/vagrant/mt-api/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php line 63 {"exception":"[object] (Doctrine\ORM\Query\QueryException(code: 0): [Semantical Error] line 0, col 234 near 'macrocategory': Error: Class GammaBundle\Entity\Macrocategory has no field or association named macrocategory at /home/vagrant/mt-api/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:63, Doctrine\ORM\Query\QueryException(code: 0): SELECT s FROM StockSelloutBundle\Entity\Stock s INNER JOIN s.customer table_customer INNER JOIN table_customer.macrocategory table_macrocategory WHERE s.year = :field_year_827 AND s.week = :field_week_467 ORDER BY table_macrocategory.macrocategory asc at /home/vagrant/mt-api/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:41)"} []

AlessandroMinoccheri commented 6 years ago

Resolved into #152