mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 15:05:47 +00:00
advanceReviewDate() should be cleared after a review, don't use unless there are any
This commit is contained in:
parent
facac031e4
commit
e310f18dae
@ -425,11 +425,14 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
|
||||
$nextDate = false;
|
||||
$options = $this->getOptions();
|
||||
|
||||
if ($options && $options->ReviewPeriodDays) {
|
||||
if ($options && $options->ReviewPeriodDays > 0) {
|
||||
$nextDate = date('Y-m-d', strtotime('+ ' . $options->ReviewPeriodDays . ' days', SS_Datetime::now()->format('U')));
|
||||
|
||||
$this->owner->NextReviewDate = $nextDate;
|
||||
$this->owner->write();
|
||||
} else {
|
||||
$this->owner->NextReviewDate = null;
|
||||
$this->owner->write();
|
||||
}
|
||||
|
||||
return (bool) $nextDate;
|
||||
@ -454,8 +457,12 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
|
||||
|
||||
$options = $this->getOptions();
|
||||
|
||||
if ($options->OwnerGroups()->count() == 0 && $options->OwnerUsers()->count() == 0) {
|
||||
if (!$options) {
|
||||
return false;
|
||||
} else {
|
||||
if ($options->OwnerGroups()->count() == 0 && $options->OwnerUsers()->count() == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$member) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user