From 22c5f3129c24ce8b1b39b29012f37f10f23f4893 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 10 Aug 2012 12:45:37 +1200 Subject: [PATCH] FIXED: Issue where viewing an archived version of a page caused invalid SQL to be generated. This would only occur with subclasses of Page. --- model/Versioned.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/Versioned.php b/model/Versioned.php index 5e938676c..151810f62 100644 --- a/model/Versioned.php +++ b/model/Versioned.php @@ -154,7 +154,7 @@ class Versioned extends DataExtension { $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\""); } }