fixes URLSegment validation for non nested urls

This commit is contained in:
Dirk Adler 2014-10-09 21:32:19 +02:00 committed by Damian Mooyman
parent 818d7e27bd
commit 1b196d8a83

View File

@ -1799,11 +1799,13 @@ class Translatable extends DataExtension implements PermissionProvider {
$IDFilter = ($this->owner->ID) ? "AND \"SiteTree\".\"ID\" <> {$this->owner->ID}" : null; $IDFilter = ($this->owner->ID) ? "AND \"SiteTree\".\"ID\" <> {$this->owner->ID}" : null;
$parentFilter = null; $parentFilter = null;
if (Config::inst()->get('SiteTree', 'nested_urls')) {
if($this->owner->ParentID) { if($this->owner->ParentID) {
$parentFilter = " AND \"SiteTree\".\"ParentID\" = {$this->owner->ParentID}"; $parentFilter = " AND \"SiteTree\".\"ParentID\" = {$this->owner->ParentID}";
} else { } else {
$parentFilter = ' AND "SiteTree"."ParentID" = 0'; $parentFilter = ' AND "SiteTree"."ParentID" = 0';
} }
}
$existingPage = SiteTree::get() $existingPage = SiteTree::get()
// disable get_one cache, as this otherwise may pick up results from when locale_filter was on // disable get_one cache, as this otherwise may pick up results from when locale_filter was on