mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENHANCEMENT Allow selection of parent page with adding page through URL - Ticket #3177. Thanks simon_w!
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@69864 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3351aef184
commit
c247db5146
@ -450,6 +450,10 @@ JS;
|
||||
$parent = isset($_REQUEST['ParentID']) ? $_REQUEST['ParentID'] : 0;
|
||||
$suffix = isset($_REQUEST['Suffix']) ? "-" . $_REQUEST['Suffix'] : null;
|
||||
|
||||
if(!$parent && isset($_REQUEST['Parent'])) {
|
||||
$page = SiteTree::get_by_url($_REQUEST['Parent']);
|
||||
if($page) $parent = $page->ID;
|
||||
}
|
||||
|
||||
if(is_numeric($parent)) $parentObj = DataObject::get_by_id("SiteTree", $parent);
|
||||
if(!$parentObj || !$parentObj->ID) $parent = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user