mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR Only set current record in CMSMain->AddForm() if its not the homepage - not ideal, but root is the more likely default given the information at hand
This commit is contained in:
parent
167bc045fe
commit
6dd0535442
@ -1085,7 +1085,13 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$parentField->setShowSearch(true);
|
$parentField->setShowSearch(true);
|
||||||
$parentField->setValue(($record) ? $record->ID : null);
|
|
||||||
|
// CMSMain->currentPageID() automatically sets the homepage,
|
||||||
|
// which we need to counteract in the default selection (which should default to root, ID=0)
|
||||||
|
$homepageSegment = RootURLController::get_homepage_link();
|
||||||
|
if($record && $record->URLSegment != $homepageSegment) {
|
||||||
|
$parentField->setValue($record->ID);
|
||||||
|
}
|
||||||
|
|
||||||
$actions = new FieldList(
|
$actions = new FieldList(
|
||||||
// $resetAction = new ResetFormAction('doCancel', _t('CMSMain.Cancel', 'Cancel')),
|
// $resetAction = new ResetFormAction('doCancel', _t('CMSMain.Cancel', 'Cancel')),
|
||||||
|
Loading…
Reference in New Issue
Block a user