Commit 4761fa45 authored by Son Nguyen's avatar Son Nguyen Committed by Robert Lyon

Setup the default values from ctime and mtime (Bug 1360977)

That fix the issue when importing an blog with no published and updated
time

behatnotneeded

Change-Id: I4cfca0f212b2e3f160d043c23c9155043607960d
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 6dadf5d5
......@@ -323,7 +323,9 @@ abstract class ArtefactType implements IArtefactType {
foreach ((array)$data as $field => $value) {
if (property_exists($this, $field)) {
if (in_array($field, array('atime', 'ctime', 'mtime'))) {
$value = strtotime($value);
if (!(!empty($value) && is_string($value) && $value = strtotime($value))) {
$value = time();
}
}
if ($field == 'tags' && !is_array($value)) {
$value = preg_split("/\s*,\s*/", trim($value));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment