mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #34 from stojg/pull/fix-deprecated-methods
BUGFIX Usage of DataList instead of deprecated DataObject::get()
This commit is contained in:
commit
b961f99842
@ -14,14 +14,9 @@ class MigrateSiteTreeLinkingTask extends BuildTask {
|
|||||||
public function run($request) {
|
public function run($request) {
|
||||||
$pages = 0;
|
$pages = 0;
|
||||||
$links = 0;
|
$links = 0;
|
||||||
|
|
||||||
$linkedPages = DataObject::get(
|
$linkedPages = new DataList('SiteTree');
|
||||||
'SiteTree',
|
$linkedPages->innerJoin('SiteTree_LinkTracking', '"SiteTree_LinkTracking"."SiteTreeID" = "SiteTree"."ID"');
|
||||||
null,
|
|
||||||
null,
|
|
||||||
'INNER JOIN "SiteTree_LinkTracking" ON "SiteTree_LinkTracking"."SiteTreeID" = "SiteTree"."ID"'
|
|
||||||
);
|
|
||||||
|
|
||||||
if($linkedPages) foreach($linkedPages as $page) {
|
if($linkedPages) foreach($linkedPages as $page) {
|
||||||
$tracking = DB::query(sprintf('SELECT "ChildID", "FieldName" FROM "SiteTree_LinkTracking" WHERE "SiteTreeID" = %d', $page->ID))->map();
|
$tracking = DB::query(sprintf('SELECT "ChildID", "FieldName" FROM "SiteTree_LinkTracking" WHERE "SiteTreeID" = %d', $page->ID))->map();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user