BUGFIX: Removed SiteTree::rewriteLink() method that is no longer necessary due to the use of shortcodes.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89444 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-10-19 04:19:41 +00:00
parent e343391bfe
commit 9289de1319

View File

@ -1370,19 +1370,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$page->write();
}
// If the URLSegment has been changed, rewrite links
if($this->isChanged('URLSegment', 2)) {
if($this->hasMethod('BackLinkTracking')) {
$links = $this->BackLinkTracking();
if($links) {
foreach($links as $link) {
$link->rewriteLink($this->original['URLSegment'] . '/', $this->URLSegment . '/');
$link->write();
}
}
}
}
parent::onAfterWrite();
}
@ -1471,23 +1458,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
return self::get_by_link($link);
}
/**
* Replace a URL in html content with a new URL.
* @param string $old The old URL
* @param string $new The new URL
*/
function rewriteLink($old, $new) {
$fields = $this->getCMSFields(null)->dataFields();
foreach($fields as $field) {
if(is_a($field, 'HtmlEditorField')) {
$fieldName = $field->Name();
$field->setValue($this->$fieldName);
$field->rewriteLink($old, $new);
$field->saveInto($this);
}
}
}
/**
* Rewrite a file URL on this page, after its been renamed.
* Triggers the onRenameLinkedAsset action on extensions.