MINOR correct order of OBW

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100323 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Tom Rix 2010-03-02 01:14:22 +00:00 committed by Sam Minnee
parent 1caedebafe
commit 1ad8186d94

View File

@ -1320,6 +1320,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
//------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------//
protected function onBeforeWrite() { protected function onBeforeWrite() {
parent::onBeforeWrite();
// If Sort hasn't been set, make this page come after it's siblings // If Sort hasn't been set, make this page come after it's siblings
if(!$this->Sort && $this->ParentID) { if(!$this->Sort && $this->ParentID) {
$this->Sort = DB::query("SELECT MAX(\"Sort\") + 1 FROM \"SiteTree\" WHERE \"ParentID\" = $this->ParentID")->value(); $this->Sort = DB::query("SELECT MAX(\"Sort\") + 1 FROM \"SiteTree\" WHERE \"ParentID\" = $this->ParentID")->value();
@ -1352,8 +1354,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
DataObject::set_context_obj(null); DataObject::set_context_obj(null);
$this->syncLinkTracking(); $this->syncLinkTracking();
parent::onBeforeWrite();
} }
function syncLinkTracking() { function syncLinkTracking() {