mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
BUG Set raw date value for embargo/expiry to avoid DateField bugs
The object property is expected to be a scalar, but the logic sets it to a DBField instance. While DataObject handles this fine, the DatetimeField logic fails and simply writes the string classname into the field. Should be fixed in DatetimeField eventually, but easier handled here for now.
This commit is contained in:
parent
900f1d144a
commit
150f68e382
@ -311,7 +311,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
* @return null
|
||||
*/
|
||||
function embargoUntilDate($datetime, $write = true) {
|
||||
$this->EmbargoedUntilDate = DBField::create_field('SS_Datetime', $datetime);;
|
||||
$this->EmbargoedUntilDate = DBField::create_field('SS_Datetime', $datetime)->Format('Y-m-d H:i:s');
|
||||
if ($write) $this->write();
|
||||
}
|
||||
|
||||
@ -345,7 +345,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
* @return null
|
||||
*/
|
||||
function expireAtDate($datetime, $write = true) {
|
||||
$this->ExpireAtDate = DBField::create_field('SS_Datetime', $datetime);
|
||||
$this->ExpireAtDate = DBField::create_field('SS_Datetime', $datetime)->Format('Y-m-d H:i:s');
|
||||
if ($write) $this->write();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user