mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Fall back to homepage record for CMSMain->PreviewLink()
This commit is contained in:
parent
38db63c3b0
commit
17131f7a2a
@ -497,6 +497,19 @@ JS;
|
|||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function currentPageID() {
|
||||||
|
$id = parent::currentPageID();
|
||||||
|
|
||||||
|
// Fall back to homepage record
|
||||||
|
if(!$id) {
|
||||||
|
$homepageSegment = RootURLController::get_homepage_link();
|
||||||
|
$homepageRecord = DataObject::get_one('SiteTree', sprintf('"URLSegment" = \'%s\'', $homepageSegment));
|
||||||
|
if($homepageRecord) $id = $homepageRecord->ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $id;
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------//
|
//------------------------------------------------------------------------------------------//
|
||||||
// Data saving handlers
|
// Data saving handlers
|
||||||
|
Loading…
Reference in New Issue
Block a user