[ticket/12012] Fix query layout

PHPBB3-12012