mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Copy "ShowInMenus" when a VirtualPage is first created (from r86357)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89171 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d2cd852df4
commit
03221dce35
@ -123,9 +123,16 @@ class VirtualPage extends Page {
|
||||
*/
|
||||
function copyFrom($source) {
|
||||
if($source) {
|
||||
foreach($this->getVirtualFields() as $virtualField)
|
||||
foreach($this->getVirtualFields() as $virtualField) {
|
||||
$this->$virtualField = $source->$virtualField;
|
||||
}
|
||||
|
||||
// We also want to copy ShowInMenus, but only if we're copying the
|
||||
// source page for the first time.
|
||||
if($this->isChanged('CopyContentFromID')) {
|
||||
$this->ShowInMenus = $source->ShowInMenus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user