mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed SiteTree->validURLSegment() to perform a DataObject::get_one() instead of raw SQL, in order for decorated filtering (e.g. by the subsites module) to apply correctly.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89236 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f792d16c01
commit
613dbf55d0
@ -1436,9 +1436,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
}
|
||||
}
|
||||
|
||||
return DB::query (
|
||||
"SELECT COUNT(\"ID\") FROM \"SiteTree\" WHERE \"URLSegment\" = '$this->URLSegment' $IDFilter $parentFilter"
|
||||
)->value() < 1;
|
||||
$existingPage = DataObject::get_one(
|
||||
'SiteTree',
|
||||
"\"URLSegment\" = '$this->URLSegment' $IDFilter $parentFilter"
|
||||
);
|
||||
return !($existingPage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user