diff --git a/README.md b/README.md index 962650a..a788864 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Requirements - * SilverStripe 2.4 + * SilverStripe 3.0 ## Documentation @@ -22,5 +22,5 @@ See http://en.wikipedia.org/wiki/Sitemaps for info on this format ## Usage Overview -See docs/en/* for more information about configuring the module. +See docs/en for more information about configuring the module. diff --git a/code/GoogleSitemap.php b/code/GoogleSitemap.php index d36f5af..d1c8758 100644 --- a/code/GoogleSitemap.php +++ b/code/GoogleSitemap.php @@ -102,10 +102,10 @@ class GoogleSitemap extends Controller { * Adds DataObjects to the existing DataObjectSet with pages from the * site tree * - * @return DataObjectSet + * @return ArrayList */ protected function addRegisteredDataObjects() { - $output = new DataObjectSet(); + $output = new ArrayList(); foreach(self::$google_sitemap_dataobjects as $index => $className) { $dataObjectSet = DataObject::get($className); @@ -145,7 +145,7 @@ class GoogleSitemap extends Controller { $pages = Versioned::get_by_stage('SiteTree', 'Live', $filter); - $newPages = new DataObjectSet(); + $newPages = new ArrayList(); if($pages) { foreach($pages as $page) { @@ -235,6 +235,7 @@ class GoogleSitemap extends Controller { function index($url) { if(self::$enabled) { SSViewer::set_source_file_comments(false); + $this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"'); // But we want to still render. diff --git a/tests/GoogleSitemapTest.php b/tests/GoogleSitemapTest.php index 3d4d5df..0a9e782 100644 --- a/tests/GoogleSitemapTest.php +++ b/tests/GoogleSitemapTest.php @@ -71,9 +71,8 @@ class GoogleSitemapTest extends FunctionalTest { function testDecoratorAddsFields() { $page = $this->objFromFixture('Page', 'Page1'); - $fields = $page->getCMSFields(); - - $tab = $fields->fieldByName('Root')->fieldByName('Content')->fieldByName('GoogleSitemap'); + $fields = $page->getSettingsFields(); + $tab = $fields->fieldByName('Root')->fieldByName('Settings')->fieldByName('GoogleSitemap'); $this->assertInstanceOf('Tab', $tab); $this->assertInstanceOf('DropdownField', $tab->fieldByName('Priority'));