BUGFIX: Hard code the migration task to use Content instead of the no-longer-used FieldName. This should probably be improved to iterate over all HTMLText fields on the model.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89460 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-10-19 05:29:46 +00:00
parent 7b8bdca931
commit d2918f40ed

View File

@ -31,10 +31,11 @@ class MigrateSiteTreeLinkingTask extends BuildTask {
foreach($tracking as $link) {
$linked = DataObject::get_by_id('SiteTree', $link['ChildID']);
$page->{$link['FieldName']} = preg_replace (
// TOOD: Replace in all HTMLText fields
$page->Content = preg_replace (
"/href *= *([\"']?){$linked->URLSegment}\/?/i",
"href=$1[sitetree_link id={$linked->ID}]",
$page->{$link['FieldName']},
$page->Content,
-1,
$replaced
);