From 0ab57094a011e630c3f6546d506b47329de5a78d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 25 May 2010 03:16:54 +0000 Subject: [PATCH] API CHANGE: SiteTree::validURLSegment extendable (#5907) Uses $this->extend('augmentValidURLSegment') so that (for instance) Translatable can hook this. (from r99849) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105538 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index d30b773b4..76cfc0f92 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1516,7 +1516,16 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid 'SiteTree', "\"URLSegment\" = '$this->URLSegment' $IDFilter $parentFilter" ); - return !($existingPage); + if ($existingPage) { + return false; + } + + $values = $this->extend('augmentValidURLSegment'); + if (count($values) && !min($values)) { + return false; + } + + return true; } /**