Browse files

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

…n instead of RecordID,Version
  • Loading branch information...
1 parent 22c5f31 commit c55b018feb0f89541f1524ba2a744f0b992c6eef @tractorcow tractorcow committed Aug 10, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 model/Versioned.php
View
3 model/Versioned.php
@@ -145,7 +145,8 @@ function augmentSQL(SQLQuery &$query, DataQuery &$dataQuery = null) {
$date = $dataQuery->getQueryParam('Versioned.date');
foreach($query->getFrom() as $table => $dummy) {
$query->renameTable($table, $table . '_versions');
- $query->replaceText("\"$table\".\"ID\"", "\"$table\".\"RecordID\"");
+ $query->replaceText("\"{$table}_versions\".\"ID\"", "\"{$table}_versions\".\"RecordID\"");
+ $query->replaceText("`{$table}_versions`.`ID`", "`{$table}_versions`.`RecordID`");
// Add all <basetable>_versions columns
foreach(self::$db_for_versions_table as $name => $type) {

0 comments on commit c55b018

Please sign in to comment.