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:
Sam Minnee 2009-10-15 22:11:26 +00:00
parent d2cd852df4
commit 03221dce35

View File

@ -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;
}
}
}
/**