-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX Set empty date to null #263
base: 6
Are you sure you want to change the base?
FIX Set empty date to null #263
Conversation
89c3647
to
3ed6eb0
Compare
@@ -509,6 +509,9 @@ public function advanceReviewDate() | |||
DBDatetime::now()->getTimestamp() | |||
); | |||
|
|||
$x=DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE); | |||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
; |
@@ -509,6 +509,9 @@ public function advanceReviewDate() | |||
DBDatetime::now()->getTimestamp() | |||
); | |||
|
|||
$x=DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this $x
variable??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug, have removed
} elseif ($nextDate === false) { | ||
$this->owner->NextReviewDate = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would it be false? You updated the return values of getReviewDate()
to not return false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remember. Looking at that method it still has return $page->obj('NextReviewDate');
so presumbably that was returning false
in some circumstances
3ed6eb0
to
8622bbe
Compare
Issue silverstripe/silverstripe-framework#11403
Setting a DBDate to false will now throw an validation exception, so set to null instead