Skip to content
This repository
Browse code

FIXED: Issue where versioned would join _versions tables on ID,Versio…

…n instead of RecordID,Version
  • Loading branch information...
commit c55b018feb0f89541f1524ba2a744f0b992c6eef 1 parent 22c5f31
Damian Mooyman authored August 10, 2012

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

  1. 3  model/Versioned.php
3  model/Versioned.php
@@ -145,7 +145,8 @@ function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
145 145
 			$date = $dataQuery->getQueryParam('Versioned.date');
146 146
 			foreach($query->getFrom() as $table => $dummy) {
147 147
 				$query->renameTable($table, $table . '_versions');
148  
-				$query->replaceText("\"$table\".\"ID\"", "\"$table\".\"RecordID\"");
  148
+				$query->replaceText("\"{$table}_versions\".\"ID\"", "\"{$table}_versions\".\"RecordID\"");
  149
+				$query->replaceText("`{$table}_versions`.`ID`", "`{$table}_versions`.`RecordID`");
149 150
 				
150 151
 				// Add all <basetable>_versions columns
151 152
 				foreach(self::$db_for_versions_table as $name => $type) {

0 notes on commit c55b018

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