Compare commits

...

2 Commits

Author SHA1 Message Date
Steve Boyd
aee13af0c2
Merge 3ed6eb0971 into cd1b9ed9f2 2024-10-15 01:19:51 +00:00
Steve Boyd
3ed6eb0971 FIX Set empty date to null 2024-10-15 14:19:44 +13:00

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;
}