mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
Merge pull request #110 from mikenz/patch-2
More Silverstripe 4 compatibility
This commit is contained in:
commit
526a0eec4d
@ -244,7 +244,7 @@ class GoogleSitemap extends Object
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($redirector) {
|
if($redirector) {
|
||||||
foreach (ClassInfo::subclassesFor('RedirectorPage') as $redirectorClass) {
|
foreach (ClassInfo::subclassesFor('SilverStripe\\CMS\\Model\\RedirectorPage') as $redirectorClass) {
|
||||||
$instances = $instances->exclude('ClassName', $redirectorClass);
|
$instances = $instances->exclude('ClassName', $redirectorClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class GoogleSitemapController extends Controller
|
|||||||
public function index($url)
|
public function index($url)
|
||||||
{
|
{
|
||||||
if (GoogleSitemap::enabled()) {
|
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('Content-Type', 'application/xml; charset="utf-8"');
|
||||||
$this->getResponse()->addHeader('X-Robots-Tag', 'noindex');
|
$this->getResponse()->addHeader('X-Robots-Tag', 'noindex');
|
||||||
@ -66,7 +66,7 @@ class GoogleSitemapController extends Controller
|
|||||||
$page = $this->request->param('OtherID');
|
$page = $this->request->param('OtherID');
|
||||||
|
|
||||||
if (GoogleSitemap::enabled() && $class && $page && ($class == SiteTree::class || $class == 'GoogleSitemapRoute' || GoogleSitemap::is_registered($class))) {
|
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('Content-Type', 'application/xml; charset="utf-8"');
|
||||||
$this->getResponse()->addHeader('X-Robots-Tag', 'noindex');
|
$this->getResponse()->addHeader('X-Robots-Tag', 'noindex');
|
||||||
|
@ -405,7 +405,7 @@ class GoogleSitemapTest_OtherDataObject extends DataObject implements TestOnly
|
|||||||
class GoogleSitemapTest_UnviewableDataObject extends DataObject implements TestOnly
|
class GoogleSitemapTest_UnviewableDataObject extends DataObject implements TestOnly
|
||||||
{
|
{
|
||||||
|
|
||||||
public static $db = array(
|
private static $db = array(
|
||||||
'Priority' => 'Varchar(10)'
|
'Priority' => 'Varchar(10)'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user