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\""); } }