Add the "publication date" default value in the blog and gleaning types

This commit is contained in:
David Valdez 2019-09-30 15:24:54 -05:00
parent b07c74d77e
commit 42d6b6c757
4 changed files with 24 additions and 2 deletions

View file

@ -20,7 +20,7 @@ class PublicationDateDefault extends ProcessPluginBase {
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$created_date = $row->getSourceProperty('created');
if (empty($value)) {
if (!isset($value) || empty($value)) {
$value = [0 => ['value' => date('Y-m-d\TH:i:s', $created_date)]];
}
return $value;