Permalink
Browse files

FIXED: Issue where viewing an archived version of a page caused inval…

…id SQL to be generated. This would only occur with subclasses of Page.
  • Loading branch information...
1 parent 023721a commit 22c5f3129c24ce8b1b39b29012f37f10f23f4893 @tractorcow tractorcow committed Aug 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 model/Versioned.php
View
2 model/Versioned.php
@@ -154,7 +154,7 @@ function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
$query->selectField(sprintf('"%s_versions"."%s"', $baseTable, 'RecordID'), "ID");
if($table != $baseTable) {
- $query->addFrom(array($table => " AND \"{$table}_versions\".\"Version\" = \"{$baseTable}_versions\".\"Version\""));
+ $query->addWhere("\"{$table}_versions\".\"Version\" = \"{$baseTable}_versions\".\"Version\"");
}
}

0 comments on commit 22c5f31

Please sign in to comment.