Fix History foreign objects queries at DetailActivity