mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed ModelAsController::findOldPage() failing on MSSQLDatabase using "sqlsrv" driver
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@94885 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d6b4ad39d8
commit
060c54370e
@ -131,14 +131,13 @@ class ModelAsController extends Controller implements NestedController {
|
||||
1
|
||||
);
|
||||
|
||||
if(($result = $query->execute()) && $result->numRecords()) {
|
||||
$recordID = $result->column();
|
||||
|
||||
if($oldPage = DataObject::get_by_id('SiteTree', $recordID[0])) {
|
||||
// Run the page through an extra filter to ensure that all decorators are applied.
|
||||
if(SiteTree::get_by_link($oldPage->RelativeLink())) return $oldPage;
|
||||
}
|
||||
$record = $query->execute()->first();
|
||||
if(!$record) return false;
|
||||
|
||||
if($oldPage = DataObject::get_by_id('SiteTree', $record['RecordID'])) {
|
||||
// Run the page through an extra filter to ensure that all decorators are applied.
|
||||
if(SiteTree::get_by_link($oldPage->RelativeLink())) return $oldPage;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user