From 1dcd84e0985b944c9dd5946e31474317c4d25ba8 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 4 May 2009 05:04:08 +0000 Subject: [PATCH] MINOR: Fixed test execution for SubsitesVirtualPage --- code/SubsitesVirtualPage.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/SubsitesVirtualPage.php b/code/SubsitesVirtualPage.php index 204ad8c..605a8b3 100644 --- a/code/SubsitesVirtualPage.php +++ b/code/SubsitesVirtualPage.php @@ -31,9 +31,12 @@ class SubsitesVirtualPage extends VirtualPage { "SiteTree" ); $pageSelectionField->setFilterFunction(create_function('$item', 'return $item->ClassName != "VirtualPage";')); - $subsiteID = Controller::curr()->getRequest()->getVar('TreeDropdownField_Form_EditForm_CopyContentFromID_SubsiteID'); - if($subsiteID) { - $pageSelectionField->setSubsiteID($subsiteID); + + if(Controller::curr()->getRequest()) { + $subsiteID = Controller::curr()->getRequest()->getVar('TreeDropdownField_Form_EditForm_CopyContentFromID_SubsiteID'); + if($subsiteID) { + $pageSelectionField->setSubsiteID($subsiteID); + } } $fields->replaceField('CopyContentFromID', $pageSelectionField);