mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge branch '3.4' into 3
This commit is contained in:
commit
00d16ec276
@ -545,6 +545,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
return $id;
|
||||
}
|
||||
else if($id && is_numeric($id)) {
|
||||
$currentStage = Versioned::get_reading_mode();
|
||||
|
||||
if($this->getRequest()->getVar('Version')) {
|
||||
$versionID = (int) $this->getRequest()->getVar('Version');
|
||||
}
|
||||
@ -562,7 +564,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
singleton($treeClass)->flushCache();
|
||||
|
||||
$record = DataObject::get_by_id($treeClass, $id);
|
||||
if($record) Versioned::set_reading_mode('');
|
||||
}
|
||||
|
||||
// Then, try getting a deleted record
|
||||
@ -581,6 +582,9 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
$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') {
|
||||
|
Loading…
Reference in New Issue
Block a user