mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
BUGFIX Fixed field addition bug in SubsitesVirtualPage
This commit is contained in:
parent
83fb26cc3e
commit
3315786c66
@ -10,17 +10,19 @@ class SubsitesVirtualPage extends VirtualPage {
|
|||||||
$subsites->push(new ArrayData(array('Title' => 'Main site', 'ID' => 0)));
|
$subsites->push(new ArrayData(array('Title' => 'Main site', 'ID' => 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($subsites->Count()) $subsiteSelectionField = new DropdownField(
|
if($subsites->Count()) {
|
||||||
"CopyContentFromID_SubsiteID",
|
$subsiteSelectionField = new DropdownField(
|
||||||
"Subsite",
|
"CopyContentFromID_SubsiteID",
|
||||||
$subsites->toDropdownMap('ID', 'Title'),
|
"Subsite",
|
||||||
($this->CopyContentFromID) ? $this->CopyContentFrom()->SubsiteID : Session::get('SubsiteID')
|
$subsites->toDropdownMap('ID', 'Title'),
|
||||||
);
|
($this->CopyContentFromID) ? $this->CopyContentFrom()->SubsiteID : Session::get('SubsiteID')
|
||||||
$fields->addFieldToTab(
|
);
|
||||||
'Root.Content.Main',
|
$fields->addFieldToTab(
|
||||||
$subsiteSelectionField,
|
'Root.Content.Main',
|
||||||
'CopyContentFromID'
|
$subsiteSelectionField,
|
||||||
);
|
'CopyContentFromID'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Setup the linking to the original page.
|
// Setup the linking to the original page.
|
||||||
$pageSelectionField = new SubsitesTreeDropdownField(
|
$pageSelectionField = new SubsitesTreeDropdownField(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user