API CHANGE: Removed context object - it's a hack.

This commit is contained in:
Sam Minnee 2011-03-21 19:58:01 +13:00 committed by Ingo Schommer
parent d3ca4dac5b
commit f2ed229be4

View File

@ -1388,16 +1388,12 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$this->URLSegment = $segment; $this->URLSegment = $segment;
} }
DataObject::set_context_obj($this);
// Ensure that this object has a non-conflicting URLSegment value. // Ensure that this object has a non-conflicting URLSegment value.
$count = 2; $count = 2;
while(!$this->validURLSegment()) { while(!$this->validURLSegment()) {
$this->URLSegment = preg_replace('/-[0-9]+$/', null, $this->URLSegment) . '-' . $count; $this->URLSegment = preg_replace('/-[0-9]+$/', null, $this->URLSegment) . '-' . $count;
$count++; $count++;
} }
DataObject::set_context_obj(null);
$this->syncLinkTracking(); $this->syncLinkTracking();