LPS-40027 Fixing problems when importing an entity that is trashed