From 7c9420d166df2ed89948691933396fc2e352e0d2 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 30 Oct 2024 12:48:31 +1300 Subject: [PATCH] FIX Set empty date to null --- src/Extensions/SiteTreeContentReview.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Extensions/SiteTreeContentReview.php b/src/Extensions/SiteTreeContentReview.php index 81cb82f..ad858ff 100644 --- a/src/Extensions/SiteTreeContentReview.php +++ b/src/Extensions/SiteTreeContentReview.php @@ -194,7 +194,7 @@ protected function updateCMSActions(FieldList $actions) * * @param SiteTree $page * - * @return bool|DBDate + * @return null|DBDate */ public function getReviewDate(SiteTree $page = null) { @@ -209,11 +209,11 @@ public function getReviewDate(SiteTree $page = null) $options = $this->owner->getOptions(); if (!$options) { - return false; + return null; } if (!$options->ReviewPeriodDays) { - return false; + return null; } // Failover to check on ReviewPeriodDays + LastEdited @@ -508,7 +508,6 @@ public function advanceReviewDate() ' + ' . $options->ReviewPeriodDays . ' days', DBDatetime::now()->getTimestamp() ); - $this->owner->NextReviewDate = DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE); $this->owner->write(); }