mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
Merge branch '5.1' into 5
This commit is contained in:
commit
3156d4ea3c
@ -1,8 +1,5 @@
|
|||||||
import jQuery from 'jquery';
|
import jQuery from 'jquery';
|
||||||
|
|
||||||
/**
|
|
||||||
* @todo Re-validate this with Subsites
|
|
||||||
*/
|
|
||||||
jQuery.entwine('ss', ($) => {
|
jQuery.entwine('ss', ($) => {
|
||||||
// Hide all owner dropdowns except the one for the current subsite
|
// Hide all owner dropdowns except the one for the current subsite
|
||||||
function showCorrectSubsiteIDDropdown(value) {
|
function showCorrectSubsiteIDDropdown(value) {
|
||||||
|
@ -129,8 +129,6 @@ class ContentReviewCMSExtension extends LeftAndMainExtension
|
|||||||
* Check if the current request has a X-Formschema-Request header set.
|
* Check if the current request has a X-Formschema-Request header set.
|
||||||
* Used by conditional logic that responds to validation results
|
* Used by conditional logic that responds to validation results
|
||||||
*
|
*
|
||||||
* @todo Remove duplication. See https://github.com/silverstripe/silverstripe-admin/issues/240
|
|
||||||
*
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function getSchemaRequested()
|
protected function getSchemaRequested()
|
||||||
@ -142,8 +140,6 @@ class ContentReviewCMSExtension extends LeftAndMainExtension
|
|||||||
/**
|
/**
|
||||||
* Generate schema for the given form based on the X-Formschema-Request header value
|
* Generate schema for the given form based on the X-Formschema-Request header value
|
||||||
*
|
*
|
||||||
* @todo Remove duplication. See https://github.com/silverstripe/silverstripe-admin/issues/240
|
|
||||||
*
|
|
||||||
* @param string $schemaID ID for this schema. Required.
|
* @param string $schemaID ID for this schema. Required.
|
||||||
* @param Form $form Required for 'state' or 'schema' response
|
* @param Form $form Required for 'state' or 'schema' response
|
||||||
* @param ValidationResult $errors Required for 'error' response
|
* @param ValidationResult $errors Required for 'error' response
|
||||||
|
@ -179,7 +179,6 @@ class PagesDueForReviewReport extends Report
|
|||||||
} else {
|
} else {
|
||||||
// Review date before
|
// Review date before
|
||||||
if (!empty($params['ReviewDateBefore'])) {
|
if (!empty($params['ReviewDateBefore'])) {
|
||||||
// TODO Get value from DateField->dataValue() once we have access to form elements here
|
|
||||||
$nextReviewUnixSec = strtotime(
|
$nextReviewUnixSec = strtotime(
|
||||||
' + 1 day',
|
' + 1 day',
|
||||||
strtotime($params['ReviewDateBefore'] ?? '')
|
strtotime($params['ReviewDateBefore'] ?? '')
|
||||||
@ -194,7 +193,6 @@ class PagesDueForReviewReport extends Report
|
|||||||
|
|
||||||
// Review date after
|
// Review date after
|
||||||
if (!empty($params['ReviewDateAfter'])) {
|
if (!empty($params['ReviewDateAfter'])) {
|
||||||
// TODO Get value from DateField->dataValue() once we have access to form elements here
|
|
||||||
$records = $records->where(
|
$records = $records->where(
|
||||||
sprintf(
|
sprintf(
|
||||||
"\"NextReviewDate\" >= '%s'",
|
"\"NextReviewDate\" >= '%s'",
|
||||||
|
@ -4,8 +4,6 @@ namespace SilverStripe\ContentReview\Tests;
|
|||||||
|
|
||||||
use SilverStripe\Dev\FunctionalTest;
|
use SilverStripe\Dev\FunctionalTest;
|
||||||
use SilverStripe\CMS\Model\SiteTree;
|
use SilverStripe\CMS\Model\SiteTree;
|
||||||
// @todo add translatable namespace
|
|
||||||
use Translatable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend this class when writing unit tests which are compatible with other modules.
|
* Extend this class when writing unit tests which are compatible with other modules.
|
||||||
@ -17,36 +15,4 @@ abstract class ContentReviewBaseTest extends FunctionalTest
|
|||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $translatableEnabledBefore;
|
protected $translatableEnabledBefore;
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We set the locale for pages explicitly, because if we don't, then we get into a situation
|
|
||||||
* where the page takes on the tester's (your) locale, and any calls to simulate subsequent requests
|
|
||||||
* (e.g. $this->post()) do not seem to get passed the tester's locale,
|
|
||||||
* but instead fallback to the default locale.
|
|
||||||
*
|
|
||||||
* So we set the pages locale to be the default locale, which will then match any subsequent requests.
|
|
||||||
*
|
|
||||||
* If creating pages in your unit tests (rather than reading from the fixtures file), you must explicitly call
|
|
||||||
* self::compat() on the page, for the same reasons as above.
|
|
||||||
*/
|
|
||||||
if (class_exists(Translatable::class)) {
|
|
||||||
$this->translatableEnabledBefore = SiteTree::has_extension(Translatable::class);
|
|
||||||
SiteTree::remove_extension(Translatable::class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function tearDown(): void
|
|
||||||
{
|
|
||||||
if (class_exists(Translatable::class)) {
|
|
||||||
if ($this->translatableEnabledBefore) {
|
|
||||||
SiteTree::add_extension(Translatable::class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::tearDown();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user