Ensure we have a list of valid ids before trying to retrieve them from the database.
Merge branch 'dev' into contao3
Merge branch 'contao3' into tng