Commit f928cf31 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>
(cherry picked from commit 4761fa45)
(cherry picked from commit 8b893b44)
parent 5c65c7e3
......@@ -279,7 +279,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