我在symfony 2.8中遇到此错误:
3/3] Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("[Syntax Error] line 0, col 128: Error: Expected Literal, got 'ORDER'"). -
第33行是
{% if admin.datagrid.results|length > 0 %}
和
QueryException ::dqlError ('SELECT o FROM Work\SeoControlBundle\Entity\Domain o LEFT JOIN o.strategy s_strategy LEFT JOIN o.renderer s_renderer WHERE ORDER BY o.id ASC')
in vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php at line 448
答案 0 :(得分:0)
欢迎使用SO。
您的WHERE
条件为空。删除它或用必要的条件填充它:)
SELECT o FROM Work\SeoControlBundle\Entity\Domain o LEFT JOIN o.strategy s_strategy LEFT JOIN o.renderer s_renderer ORDER BY o.id ASC
或
SELECT o FROM Work\SeoControlBundle\Entity\Domain o LEFT JOIN o.strategy s_strategy LEFT JOIN o.renderer s_renderer WHERE XXX=YYY ORDER BY o.id ASC
答案 1 :(得分:0)
您只需要更改您的存储库类文件。删除where条件,因为它似乎为空。