Fix check for alias if ContentType uses a custom `tablename`.
Fix check for alias if ContentType uses a custom `tablename`.

Fixes #6007
Intendit/bolt,lenvanessen/bolt,bolt/bolt,electrolinux/bolt,electrolinux/bolt,bolt/bolt,joshuan/bolt,lenvanessen/bolt,Intendit/bolt,HonzaMikula/masivnipostele,nikgo/bolt,GawainLynch/bolt,romulo1984/bolt,bolt/bolt,Intendit/bolt,HonzaMikula/masivnipostele,joshuan/bolt,romulo1984/bolt,lenvanessen/bolt,GawainLynch/bolt,electrolinux/bolt,romulo1984/bolt,lenvanessen/bolt,nikgo/bolt,joshuan/bolt,HonzaMikula/masivnipostele,electrolinux/bolt,HonzaMikula/masivnipostele,joshuan/bolt,GawainLynch/bolt,nikgo/bolt,nikgo/bolt,GawainLynch/bolt,romulo1984/bolt,Intendit/bolt,bolt/bolt