mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
FIX Support blacklist for SS 4.0 and 4.1, remove old Translatable reference in test class
This commit is contained in:
parent
6feec1de34
commit
30454dc04f
@ -487,9 +487,13 @@ class SiteTreeSubsites extends DataExtension
|
||||
// Typically called on a singleton, so we're not using the Subsite() relation
|
||||
$subsite = Subsite::currentSubsite();
|
||||
if ($subsite && $subsite->exists() && $subsite->PageTypeBlacklist) {
|
||||
$blacklist = Convert::json2array($subsite->PageTypeBlacklist) ?: [];
|
||||
// SS 4.1: JSON encoded. SS 4.0, comma delimited
|
||||
$blacklist = Convert::json2array($subsite->PageTypeBlacklist);
|
||||
if ($blacklist === false) {
|
||||
$blacklist = explode(',', $subsite->PageTypeBlacklist);
|
||||
}
|
||||
|
||||
if (in_array(get_class($this->owner), $blacklist)) {
|
||||
if (in_array(get_class($this->owner), (array) $blacklist)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -21,10 +21,6 @@ class SubsitesVirtualPageTest extends BaseSubsiteTest
|
||||
'SubsitesVirtualPageTest.yml',
|
||||
];
|
||||
|
||||
protected static $illegal_extensions = [
|
||||
SiteTree::class => ['Translatable'] // @todo implement Translatable namespace
|
||||
];
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
Loading…
Reference in New Issue
Block a user