Add basic duplication ability

[MAILPOET-4540]
This commit is contained in:
John Oleksowicz
2022-09-16 18:22:14 -05:00
committed by David Remer
parent 35325bdf06
commit a4c8caa664
7 changed files with 122 additions and 41 deletions

View File

@@ -191,8 +191,8 @@ class Workflow {
}, Json::decode($data['steps'])),
new \WP_User((int)$data['author'])
);
$workflow->id = (int)$data['id'];
$workflow->versionId = (int)$data['version_id'];
$workflow->id = (int)($data['id'] ?? 0);
$workflow->versionId = (int)($data['version_id'] ?? 0);
$workflow->status = $data['status'];
$workflow->createdAt = new DateTimeImmutable($data['created_at']);
$workflow->updatedAt = new DateTimeImmutable($data['updated_at']);