Skip to content

Commit e139d8f

Browse files
Prioritizing definition's screenRef and optimizing config handling for web_entry.
1 parent 5388c23 commit e139d8f

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

ProcessMaker/Models/ProcessRequestToken.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,12 @@ public function getBpmnDefinition()
448448
public function getScreen(): ?Screen
449449
{
450450
$definition = $this->getDefinition();
451-
$config = null;
452-
if (isset($definition['config'])) {
453-
$config = json_decode($definition['config']);
454-
}
451+
$screenRef = isset($definition['screenRef']) ? $definition['screenRef'] : null;
455452

456-
$screenRef = $definition['screenRef'] ?? null;
453+
if (!$screenRef) {
454+
$config = isset($definition['config']) ? json_decode($definition['config']) : null;
457455

458-
if (!$screenRef && isset($config) && isset($config->web_entry)) {
459-
$screenRef = $config->web_entry->screen_id ?? null;
456+
$screenRef = (isset($config) && isset($config->web_entry)) ? $config->web_entry->screen_id ?? null : null;
460457
}
461458

462459
$screen = Screen::find($screenRef);

0 commit comments

Comments
 (0)