More fixes for 1.4 only on custom query definitions

--HG--
extra : source : fb13b7d85d228ecb4af008d4c2d0ad07606c9b39