mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX MigrateSiteTreeLinkingTask now takes a direct map when querying the page tracked links instead of looping through the direct result set. This fixes SQL Server failing when MARS (Multiple Active Result Sets) is disabled
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110197 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3a210c397a
commit
5160c8abd4
@ -27,13 +27,10 @@ class MigrateSiteTreeLinkingTask extends BuildTask {
|
||||
if($linkedPages) $linkedPages->removeDuplicates();
|
||||
|
||||
if($linkedPages) foreach($linkedPages as $page) {
|
||||
$tracking = DB::query(sprintf (
|
||||
'SELECT "ChildID", "FieldName" FROM "SiteTree_LinkTracking" WHERE "SiteTreeID" = %d',
|
||||
$page->ID
|
||||
));
|
||||
$tracking = DB::query(sprintf('SELECT "ChildID", "FieldName" FROM "SiteTree_LinkTracking" WHERE "SiteTreeID" = %d', $page->ID))->map();
|
||||
|
||||
foreach($tracking as $link) {
|
||||
$linked = DataObject::get_by_id('SiteTree', $link['ChildID']);
|
||||
foreach($tracking as $childID => $fieldName) {
|
||||
$linked = DataObject::get_by_id('SiteTree', $childID);
|
||||
|
||||
// TOOD: Replace in all HTMLText fields
|
||||
$page->Content = preg_replace (
|
||||
@ -48,8 +45,8 @@ class MigrateSiteTreeLinkingTask extends BuildTask {
|
||||
$links += $replaced;
|
||||
}
|
||||
}
|
||||
$page->write();
|
||||
|
||||
$page->write();
|
||||
$pages++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user