mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
API Remove Translatable compatibility logic
This commit is contained in:
parent
ad2932c418
commit
f64561e1b4
@ -4,13 +4,10 @@ namespace SilverStripe\ContentReview\Compatibility;
|
|||||||
|
|
||||||
use SilverStripe\Core\ClassInfo;
|
use SilverStripe\Core\ClassInfo;
|
||||||
use SilverStripe\Subsites\Model\Subsite;
|
use SilverStripe\Subsites\Model\Subsite;
|
||||||
use Translatable;
|
|
||||||
|
|
||||||
// @todo add translatable namespace
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a helper class which lets us do things with content review data without subsites
|
* This is a helper class which lets us do things with content review data without subsites
|
||||||
* and translatable messing our SQL queries up.
|
* messing our SQL queries up.
|
||||||
*
|
*
|
||||||
* Make sure any DataQuery instances you are building are BOTH created & executed between start()
|
* Make sure any DataQuery instances you are building are BOTH created & executed between start()
|
||||||
* and done() because augmentDataQueryCreate and augmentSQL happens there.
|
* and done() because augmentDataQueryCreate and augmentSQL happens there.
|
||||||
@ -19,8 +16,6 @@ class ContentReviewCompatability
|
|||||||
{
|
{
|
||||||
const SUBSITES = 0;
|
const SUBSITES = 0;
|
||||||
|
|
||||||
const TRANSLATABLE = 1;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the state of other modules before compatibility mode is started.
|
* Returns the state of other modules before compatibility mode is started.
|
||||||
*
|
*
|
||||||
@ -30,7 +25,6 @@ class ContentReviewCompatability
|
|||||||
{
|
{
|
||||||
$compatibility = [
|
$compatibility = [
|
||||||
self::SUBSITES => null,
|
self::SUBSITES => null,
|
||||||
self::TRANSLATABLE => null,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if (ClassInfo::exists(Subsite::class)) {
|
if (ClassInfo::exists(Subsite::class)) {
|
||||||
@ -38,11 +32,6 @@ class ContentReviewCompatability
|
|||||||
Subsite::disable_subsite_filter(true);
|
Subsite::disable_subsite_filter(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ClassInfo::exists(Translatable::class)) {
|
|
||||||
$compatibility[self::TRANSLATABLE] = Translatable::locale_filter_enabled();
|
|
||||||
Translatable::disable_locale_filter();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $compatibility;
|
return $compatibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,9 +43,5 @@ class ContentReviewCompatability
|
|||||||
if (class_exists(Subsite::class)) {
|
if (class_exists(Subsite::class)) {
|
||||||
Subsite::$disable_subsite_filter = $compatibility[self::SUBSITES];
|
Subsite::$disable_subsite_filter = $compatibility[self::SUBSITES];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (class_exists(Translatable::class)) {
|
|
||||||
Translatable::enable_locale_filter($compatibility[self::TRANSLATABLE]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user