From 9289de1319a6ea68a5ffc44f4b8f2edc2f909cb7 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 19 Oct 2009 04:19:41 +0000 Subject: [PATCH] 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 --- core/model/SiteTree.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 6b125ec47..099ebecdf 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -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.