mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
Merge branch '3'
This commit is contained in:
commit
a55d5c285a
@ -488,7 +488,10 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$options || !$options->hasExtension(__CLASS__)) {
|
||||
if (!$options
|
||||
// Options can be a SiteConfig with different extension applied
|
||||
|| (!$options->hasExtension(__CLASS__) && !$options->hasExtension(ContentReviewDefaultSettings::class))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -330,4 +330,25 @@ class SiteTreeContentReviewTest extends ContentReviewBaseTest
|
||||
|
||||
DBDatetime::clear_mock_now();
|
||||
}
|
||||
|
||||
public function testSiteConfigSettingsAreUsedAsDefaults()
|
||||
{
|
||||
DBDatetime::set_mock_now("2020-03-01 12:00:00");
|
||||
|
||||
/** @var Member $author */
|
||||
$author = $this->objFromFixture(Member::class, 'editor');
|
||||
|
||||
/** @var SiteConfig $siteConfig */
|
||||
$siteConfig = SiteConfig::current_site_config();
|
||||
|
||||
// Set the author to a default user for reviewing
|
||||
$siteConfig->OwnerUsers()->add($author);
|
||||
|
||||
$emptyPage = new Page;
|
||||
$emptyPage->NextReviewDate = '2020-02-20 12:00:00';
|
||||
|
||||
$this->assertTrue($emptyPage->canBeReviewedBy($author));
|
||||
|
||||
DBDatetime::clear_mock_now();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user