Single Table Inheritance getSimilarSlugs issue

If the top-most parent class, does not have slug field but, the parent class in the middle has one. The getSimilarSlugs could not find similar slugs, causing SQL error in the database. 
Submitted a test case and a fix. Hope it gets soon into master.