Skip to content
This repository
Browse code

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...
commit 22c5f3129c24ce8b1b39b29012f37f10f23f4893 1 parent 023721a
Damian Mooyman authored August 10, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  model/Versioned.php
2  model/Versioned.php
@@ -154,7 +154,7 @@ function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
154 154
 				$query->selectField(sprintf('"%s_versions"."%s"', $baseTable, 'RecordID'), "ID");
155 155
 
156 156
 				if($table != $baseTable) {
157  
-					$query->addFrom(array($table => " AND \"{$table}_versions\".\"Version\" = \"{$baseTable}_versions\".\"Version\""));
  157
+					$query->addWhere("\"{$table}_versions\".\"Version\" = \"{$baseTable}_versions\".\"Version\"");
158 158
 				}
159 159
 			}
160 160
 

0 notes on commit 22c5f31

Please sign in to comment.
Something went wrong with that request. Please try again.