mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
e343391bfe
commit
9289de1319
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user