From 4333bb67771d219ef9c42b3febff6089f1a63ab5 Mon Sep 17 00:00:00 2001 From: Mike Cochrane Date: Sun, 6 Nov 2016 16:19:01 +1300 Subject: [PATCH 1/3] More Silverstrie 4 compatibility --- code/GoogleSitemap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/GoogleSitemap.php b/code/GoogleSitemap.php index 947117a..6f9234b 100644 --- a/code/GoogleSitemap.php +++ b/code/GoogleSitemap.php @@ -244,7 +244,7 @@ class GoogleSitemap extends Object } if($redirector) { - foreach (ClassInfo::subclassesFor('RedirectorPage') as $redirectorClass) { + foreach (ClassInfo::subclassesFor('SilverStripe\\CMS\\Model\\RedirectorPage') as $redirectorClass) { $instances = $instances->exclude('ClassName', $redirectorClass); } } From 9f845f5af7e9144ab4d856138402f118f4e891fb Mon Sep 17 00:00:00 2001 From: Mike Cochrane Date: Sun, 6 Nov 2016 16:24:03 +1300 Subject: [PATCH 2/3] More Silverstripe 4 compatibility --- code/controllers/GoogleSitemapController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/controllers/GoogleSitemapController.php b/code/controllers/GoogleSitemapController.php index 75d86a7..faebef3 100644 --- a/code/controllers/GoogleSitemapController.php +++ b/code/controllers/GoogleSitemapController.php @@ -38,7 +38,7 @@ class GoogleSitemapController extends Controller public function index($url) { if (GoogleSitemap::enabled()) { - Config::inst()->update('SSViewer', 'set_source_file_comments', false); + Config::inst()->update('SilverStripe\\View\\SSViewer', 'set_source_file_comments', false); $this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"'); $this->getResponse()->addHeader('X-Robots-Tag', 'noindex'); @@ -66,7 +66,7 @@ class GoogleSitemapController extends Controller $page = $this->request->param('OtherID'); if (GoogleSitemap::enabled() && $class && $page && ($class == SiteTree::class || $class == 'GoogleSitemapRoute' || GoogleSitemap::is_registered($class))) { - Config::inst()->update('SSViewer', 'set_source_file_comments', false); + Config::inst()->update('SilverStripe\\View\\SSViewer', 'set_source_file_comments', false); $this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"'); $this->getResponse()->addHeader('X-Robots-Tag', 'noindex'); From b8766edbeef1882abad7c769ec421c4826fdaadd Mon Sep 17 00:00:00 2001 From: Mike Cochrane Date: Sun, 6 Nov 2016 16:28:05 +1300 Subject: [PATCH 3/3] More Silverstripe 4 compatibility --- tests/GoogleSitemapTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/GoogleSitemapTest.php b/tests/GoogleSitemapTest.php index 2abbe90..ac2d34d 100644 --- a/tests/GoogleSitemapTest.php +++ b/tests/GoogleSitemapTest.php @@ -405,7 +405,7 @@ class GoogleSitemapTest_OtherDataObject extends DataObject implements TestOnly class GoogleSitemapTest_UnviewableDataObject extends DataObject implements TestOnly { - public static $db = array( + private static $db = array( 'Priority' => 'Varchar(10)' );