Fix that DbQuery::renderFilter produces invalid filters

fixes #7749
Merge remote-tracking branch 'origin/master' into bugfix/dashboard-rework-7751