In my post yesterday entitled "Subsite Module SS3 "All Pages, Including Deleted" Broken" I hinted at a Versioned.php issue
I believe the augment sql code at line 242 to be in error. It does not even work when used in mysql directly as there appears to be a join missing.
The sql should be thus
if($dataQuery->getQueryParam('Versioned.mode') == 'latest_versions') {
$query->addWhere(
"\"{$alias}_versions\".\"Version\" IN
(SELECT LatestVersion FROM
(SELECT
\"{$alias}_versions\".\"RecordID\",
MAX(\"{$alias}_versions\".\"Version\") AS LatestVersion
FROM \"{$alias}_versions\"
GROUP BY \"{$alias}_versions\".\"RecordID\"
) AS \"{$alias}_versions_latest\" JOIN \"{$alias}_versions\"
WHERE \"{$alias}_versions_latest\".\"RecordID\" = \"{$alias}_versions\".\"RecordID\"
)");
}
Note the join in the next to last line. I have not refined this further and there are still probable subsite issues. Feel free to test this by deleted all the pages in a site and then try viewing "All pages, including deleted" with and without this join.
I was unable to post this as an issue on github as it is not enabled for me.