Skip to content

Commit

Permalink
Merge branch '3.4' into 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Jul 12, 2016
2 parents 3c00110 + a2657b5 commit 00d16ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/controllers/CMSMain.php
Expand Up @@ -545,6 +545,8 @@ public function getRecord($id, $versionID = null) {
return $id;
}
else if($id && is_numeric($id)) {
$currentStage = Versioned::get_reading_mode();

if($this->getRequest()->getVar('Version')) {
$versionID = (int) $this->getRequest()->getVar('Version');
}
Expand All @@ -562,7 +564,6 @@ public function getRecord($id, $versionID = null) {
singleton($treeClass)->flushCache();

$record = DataObject::get_by_id($treeClass, $id);
if($record) Versioned::set_reading_mode('');
}

// Then, try getting a deleted record
Expand All @@ -581,6 +582,9 @@ public function getRecord($id, $versionID = null) {
$record = null;
}*/

// Set the reading mode back to what it was.
Versioned::set_reading_mode($currentStage);

return $record;

} else if(substr($id,0,3) == 'new') {
Expand Down

0 comments on commit 00d16ec

Please sign in to comment.