From ec4432734b2d8a3570513ff225600464374b3f9d Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Wed, 3 Feb 2021 15:55:01 -0400 Subject: [PATCH] PMCORE-1695 Datasource property does not work in a suggest control when it is inside a grid control. --- .../engine/src/ProcessMaker/BusinessModel/Variable.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php b/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php index 119f0cdf4..b47467564 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php @@ -817,6 +817,15 @@ class Variable //in the current change there is no specific property that indicates //if the control is in the grid. if (isset($field->columnWidth)) { + if (!empty($field->dataVariable)) { + //this support the global variable for @?, only access grids + //for access to all variables, replace with '/^\s*@.(.+)\s*$/' + $dataVariable = preg_match('/^\s*@\?(.+)\s*$/', $field->dataVariable, $arrayMatch) ? $arrayMatch[1] : $json->dataVariable; + if (isset($params[$dataVariable]) && is_array($params[$dataVariable])) { + $globalVariables[$dataVariable] = $params[$dataVariable]; + $paramsAndGlobal[$dataVariable] = $params[$dataVariable]; + } + } $pmDynaform->fields["APP_DATA"] = $globalVariables; $field->queryInputData = $paramsAndGlobal; }