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

Issue #3525841: Introduce WorkflowItem::getWorkflowId()

parent 719f5a5c
No related branches found
No related tags found
No related merge requests found
Pipeline #503614 passed with warnings
......@@ -94,11 +94,11 @@ trait WorkflowTypeAttributeTrait {
}
try {
// WorkflowItem.
$this->wid = $this->getSetting('workflow_type');
if ($this->wid) {
return $this->wid;
}
// WorkflowItem. Is already set in WorkflowItem::__construct().
// $this->wid = $this->getSetting('workflow_type');
// if (!empty($this->wid)) {
// return $this->wid;
// }
}
catch (\Error $e) {
// Error: Call to undefined method Drupal\workflow\Entity\WorkflowTransition::getSetting()
......@@ -108,9 +108,9 @@ trait WorkflowTypeAttributeTrait {
// WorkflowTransition.
$value = $this->get('wid');
$this->wid = match (TRUE) {
// In WorkflowTransition.
is_object($value) => $value->getValue()[0]['target_id'] ?? '',
// In ...
// 'entity_reference' in WorkflowTransition.
is_object($value) => $value->{'target_id'} ?? '',
// 'list_string' in WorkflowTransition.
is_string($value) => $value,
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment