This commit is contained in:
Steve Boyd 2024-10-15 01:19:51 +00:00 committed by GitHub
commit aee13af0c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,7 +194,7 @@ class SiteTreeContentReview extends Extension implements PermissionProvider
*
* @param SiteTree $page
*
* @return bool|DBDate
* @return null|DBDate
*/
public function getReviewDate(SiteTree $page = null)
{
@ -209,11 +209,11 @@ class SiteTreeContentReview extends Extension implements PermissionProvider
$options = $this->owner->getOptions();
if (!$options) {
return false;
return null;
}
if (!$options->ReviewPeriodDays) {
return false;
return null;
}
// Failover to check on ReviewPeriodDays + LastEdited
@ -509,6 +509,9 @@ class SiteTreeContentReview extends Extension implements PermissionProvider
DBDatetime::now()->getTimestamp()
);
$x=DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE);
;
$this->owner->NextReviewDate = DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE);
$this->owner->write();
}
@ -662,6 +665,8 @@ class SiteTreeContentReview extends Extension implements PermissionProvider
if (is_object($nextDate)) {
$this->owner->NextReviewDate = $nextDate->getValue();
} elseif ($nextDate === false) {
$this->owner->NextReviewDate = null;
} else {
$this->owner->NextReviewDate = $nextDate;
}