mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUG prevent "Home page" being selected when no selection was made
Fixes #1351
This commit is contained in:
parent
e706b147cc
commit
7c4e6f4b60
@ -869,15 +869,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
|
|
||||||
$this->extend('updateCurrentPageID', $id);
|
$this->extend('updateCurrentPageID', $id);
|
||||||
|
|
||||||
// Fall back to homepage record
|
|
||||||
if(!$id) {
|
|
||||||
$homepageSegment = RootURLController::get_homepage_link();
|
|
||||||
$homepageRecord = DataObject::get_one('SiteTree', array(
|
|
||||||
'"SiteTree"."URLSegment"' => $homepageSegment
|
|
||||||
));
|
|
||||||
if($homepageRecord) $id = $homepageRecord->ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user