API CHANGE: SiteTree::validURLSegment extendable (#5907)

Uses $this->extend('augmentValidURLSegment')
so that (for instance) Translatable can hook this.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99849 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Luke Hudson 2010-02-24 23:32:41 +00:00 committed by Sam Minnee
parent 3ec85156d1
commit 5531e01a69

View File

@ -1499,7 +1499,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;
}
/**