mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
Remove translatable filter.
This commit is contained in:
parent
8ebf4e9f22
commit
12e46e5b2b
@ -175,8 +175,15 @@ class GoogleSitemap {
|
||||
$count = Config::inst()->get('GoogleSitemap', 'objects_per_sitemap');
|
||||
$filter = Config::inst()->get('GoogleSitemap', 'use_show_in_search');
|
||||
|
||||
// todo migrate to extension hook or DI point for other modules to
|
||||
// modify state filters
|
||||
if(class_exists('Translatable')) {
|
||||
Translatable::disable_locale_filter();
|
||||
}
|
||||
|
||||
if($class == "SiteTree") {
|
||||
$filter = ($filter) ? "\"ShowInSearch\" = 1" : "";
|
||||
|
||||
$instances = Versioned::get_by_stage('SiteTree', 'Live', $filter);
|
||||
}
|
||||
else if($class == "GoogleSitemapRoute") {
|
||||
@ -263,6 +270,12 @@ class GoogleSitemap {
|
||||
$filter = Config::inst()->get('GoogleSitemap', 'use_show_in_search');
|
||||
|
||||
if(class_exists('SiteTree')) {
|
||||
// move to extension hook. At the moment moduleexists config hook
|
||||
// does not work.
|
||||
if(class_exists('Translatable')) {
|
||||
Translatable::disable_locale_filter();
|
||||
}
|
||||
|
||||
$filter = ($filter) ? "\"ShowInSearch\" = 1" : "";
|
||||
$instances = Versioned::get_by_stage('SiteTree', 'Live', $filter);
|
||||
$count = $instances->count();
|
||||
|
Loading…
Reference in New Issue
Block a user