From 840f664cd973ad5de7f6d827b5cadba9cb3ace95 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Thu, 11 May 2017 06:56:53 +1200 Subject: [PATCH] Update namespace paths for versioned split --- code/GoogleSitemap.php | 2 +- code/extensions/GoogleSitemapSiteTreeExtension.php | 2 +- tests/GoogleSitemapTest.php | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/code/GoogleSitemap.php b/code/GoogleSitemap.php index 1ced914..39822bc 100644 --- a/code/GoogleSitemap.php +++ b/code/GoogleSitemap.php @@ -7,7 +7,7 @@ use SilverStripe\Core\Config\Config; use SilverStripe\Core\Object; use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\DataList; -use SilverStripe\ORM\Versioning\Versioned; +use SilverStripe\Versioned\Versioned; use SilverStripe\View\ArrayData; /** diff --git a/code/extensions/GoogleSitemapSiteTreeExtension.php b/code/extensions/GoogleSitemapSiteTreeExtension.php index 779ef3a..1fb654e 100644 --- a/code/extensions/GoogleSitemapSiteTreeExtension.php +++ b/code/extensions/GoogleSitemapSiteTreeExtension.php @@ -114,7 +114,7 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension $priority = $this->owner->getField('Priority'); if (!$priority) { - $parentStack = $this->owner->parentStack(); + $parentStack = $this->owner->getAncestors(); $numParents = is_array($parentStack) ? count($parentStack) - 1 : 0; $num = max(0.1, 1.0 - ($numParents / 10)); diff --git a/tests/GoogleSitemapTest.php b/tests/GoogleSitemapTest.php index ac2d34d..de9c8ce 100644 --- a/tests/GoogleSitemapTest.php +++ b/tests/GoogleSitemapTest.php @@ -10,7 +10,7 @@ use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\Tab; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DB; -use SilverStripe\ORM\Versioning\Versioned; +use SilverStripe\Versioned\Versioned; /** * TODO: Migrate to new instance level interface instead of using static methods for retrieval of site maps and items (i.e. ->getSitemaps() instead of ::get_sitemaps()). @@ -20,7 +20,6 @@ use SilverStripe\ORM\Versioning\Versioned; */ class GoogleSitemapTest extends FunctionalTest { - public static $fixture_file = 'googlesitemaps/tests/GoogleSitemapTest.yml'; protected $extraDataObjects = array(