Extract workflow duplication logic to a controller, fix some issues

[MAILPOET-4540]
This commit is contained in:
Jan Jakes
2022-10-13 14:37:44 +02:00
committed by David Remer
parent 6158f5a64b
commit 89c43a5cb9
6 changed files with 115 additions and 45 deletions

View File

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