DDC-3281: Error: Expected Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS, got 'S' #4060

Closed
opened 2026-01-22 14:34:29 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 28, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user David Soussan:

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("[Syntax Error] line 0, col 545: Error: Expected Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS, got 'S'") in SonataAdminBundle:CRUD:base_list.html.twig at line 33.

QueryException: SELECT o FROM TLF\PortalBundle\Entity\Company o WHERE o.name IN ('EWEN MACRAE (WEST END GARAGE) LIMITED','F.A.M. ENGINEERING LTD','FIFE ACCIDENT REPAIR CENTRE LIMITED','FORREST RESCUE','FOURWINDS GARAGE','FRED HENDERSON LIMITED','FURNESS CARS & COMMERCIALS LTD','FYLINGDALES SERVICE STATION','G BANNERMAN (TAIN) LIMITED','GALLOWS WOOD SERVICE STATION LIMITED','GLENDINNING BROS.','GLENGYLE GARAGE LTD','GRAHAMS VEHICLE REPAIRS','GREENPARK GARAGE LIMITED','GRIFFIN`S RESCUE LIMITED','GWALIA RECOVERY LIMITED','H K MOTORS (WALES) LIMITED','HARDY'S RECOVERY LIMITED','HIGHFIELD GARAGE & RECOVERY LIMITED','HINTON RESCUE','HORNE PARK GARAGE LIMITED','Independent Inspections','J & J CAMPSIE LIMITED','J D MACADAM & SON (RESCUE) LIMITED','J.H HENDERSON & SONS LIMITED') ORDER BY o.name ASC

This error is generated by the SonataAdminBundle when fetching entities for display in the admin list. The query is generated by the bundle and one can see the escape character in the query: ,'HARDY'S RECOVERY LIMITED', but the Lexer is not escaping the apostrophe but rather sees it as the string terminator. Hence the error.

My composer.lock is attached.

Originally created by @doctrinebot on GitHub (Aug 28, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user David Soussan: Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("[Syntax Error] line 0, col 545: Error: Expected Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS, got 'S'") in SonataAdminBundle:CRUD:base_list.html.twig at line 33. QueryException: SELECT o FROM TLF\PortalBundle\Entity\Company o WHERE o.name IN ('EWEN MACRAE (WEST END GARAGE) LIMITED','F.A.M. ENGINEERING LTD','FIFE ACCIDENT REPAIR CENTRE LIMITED','FORREST RESCUE','FOURWINDS GARAGE','FRED HENDERSON LIMITED','FURNESS CARS & COMMERCIALS LTD','FYLINGDALES SERVICE STATION','G BANNERMAN (TAIN) LIMITED','GALLOWS WOOD SERVICE STATION LIMITED','GLENDINNING BROS.','GLENGYLE GARAGE LTD','GRAHAMS VEHICLE REPAIRS','GREENPARK GARAGE LIMITED','GRIFFIN`S RESCUE LIMITED','GWALIA RECOVERY LIMITED','H K MOTORS (WALES) LIMITED','HARDY\'S RECOVERY LIMITED','HIGHFIELD GARAGE & RECOVERY LIMITED','HINTON RESCUE','HORNE PARK GARAGE LIMITED','Independent Inspections','J & J CAMPSIE LIMITED','J D MACADAM & SON (RESCUE) LIMITED','J.H HENDERSON & SONS LIMITED') ORDER BY o.name ASC This error is generated by the SonataAdminBundle when fetching entities for display in the admin list. The query is generated by the bundle and one can see the escape character in the query: ,'HARDY\'S RECOVERY LIMITED', but the Lexer is not escaping the apostrophe but rather sees it as the string terminator. Hence the error. My composer.lock is attached.
admin added the Bug label 2026-01-22 14:34:29 +01:00
admin closed this issue 2026-01-22 14:34:29 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 28, 2014):

Comment created by stof:

Quote escaping in DQL strings is done by doubling the quote, not by prepending a backslash. So you are not escaping it

@doctrinebot commented on GitHub (Aug 28, 2014): Comment created by stof: Quote escaping in DQL strings is done by doubling the quote, not by prepending a backslash. So you are not escaping it
Author
Owner

@doctrinebot commented on GitHub (Aug 28, 2014):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Aug 28, 2014): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Aug 29, 2014):

Comment created by David Soussan:

Thanks Chris. Since this DQL is produced by SonataAdminBundle, not me, then this is a bug in that bundle and I will raise it with them.

@doctrinebot commented on GitHub (Aug 29, 2014): Comment created by David Soussan: Thanks Chris. Since this DQL is produced by SonataAdminBundle, not me, then this is a bug in that bundle and I will raise it with them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4060