Skip to content
Snippets Groups Projects
Commit 04458d6d authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #2919482: isolate Transition::updateEntityChangedTime()

parent 13621603
No related branches found
No related tags found
No related merge requests found
Pipeline #197821 passed with warnings
......@@ -665,26 +665,28 @@ class WorkflowTransition extends ContentEntityBase implements WorkflowTransition
}
/**
* {@inheritdoc}
* Update the workflow field of the entity in two formats.
*/
public function updateEntity() {
// Update the workflow field of the entity in two formats.
$entity = $this->getTargetEntity();
$field_name = $this->getFieldName();
$to_sid = $this->getToSid();
// N.B. Align the following functions:
// - WorkflowDefaultWidget::massageFormValues();
// - WorkflowManager::executeTransition().
$items = $entity->{$field_name};
// $items->filterEmptyItems();
// $items->value = $to_sid;
// $entity->{$field_name}->value = $to_sid;
$items->setValue($to_sid);
$items->__set('_workflow_transition', $this);
// Populate the entity changed timestamp when the option is checked.
$this->updateEntityChangedTime();
}
/**
* Update the Entity's ChangedTime when the option is set.
*/
public function updateEntityChangedTime() {
if ($this->getWorkflow()->getSetting('always_update_entity')) {
$entity = $this->getTargetEntity();
// Copied from EntiyFormDisplay::updateChangedTime(EntityInterface $entity) {
if ($entity instanceof EntityChangedInterface) {
// $entity->setChangedTime($this->time->getRequestTime());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment