Skip to content
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

Open
wants to merge 1 commit into
base: 6
Choose a base branch
from

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Oct 2, 2024

Issue silverstripe/silverstripe-framework#11403

Setting a DBDate to false will now throw an validation exception, so set to null instead

@@ -509,6 +509,9 @@ public function advanceReviewDate()
DBDatetime::now()->getTimestamp()
);

$x=DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE);
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
;

@@ -509,6 +509,9 @@ public function advanceReviewDate()
DBDatetime::now()->getTimestamp()
);

$x=DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE);
Copy link
Member

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??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug, have removed

Comment on lines +668 to +665
} elseif ($nextDate === false) {
$this->owner->NextReviewDate = null;
Copy link
Member

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.

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants