diff --git a/workflow/engine/classes/class.actionsByEmailCore.php b/workflow/engine/classes/class.actionsByEmailCore.php index 0accc134c..49ebc79f9 100644 --- a/workflow/engine/classes/class.actionsByEmailCore.php +++ b/workflow/engine/classes/class.actionsByEmailCore.php @@ -45,19 +45,24 @@ class actionsByEmailCoreClass extends PMPlugin throw new Exception('The parameter $data->USR_UID is null.'); } - if ($data->TAS_UID == '') { + if ($data->TAS_UID === '') { throw new Exception('The parameter $data->TAS_UID is empty.'); } - if ($data->APP_UID == '') { + if ($data->APP_UID === '') { throw new Exception('The parameter $data->APP_UID is empty.'); } - if ($data->DEL_INDEX == '') { + if ($data->DEL_INDEX === '') { throw new Exception('The parameter $data->DEL_INDEX is empty.'); } - if ($data->USR_UID == '') { + if ($data->DEL_INDEX === 1) { + error_log('The parameter $data->DEL_INDEX is 1, you can not use ActionsByEmail in the initial task', 0); + return; + } + + if ($data->USR_UID === '') { error_log('The parameter $data->USR_UID is empty, the routed task may be a self-service type, actions by email does not work with self-service task types.', 0); } } catch(Exception $e) { diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/class.pmDynaform.php index cc6889727..1319b12cb 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/class.pmDynaform.php @@ -27,7 +27,7 @@ class pmDynaform $this->getDynaforms(); $this->synchronizeSubDynaform(); $this->getCredentials(); - if (!isset($this->fields["APP_UID"])) { + if (is_array($this->fields) && !isset($this->fields["APP_UID"])) { $this->fields["APP_UID"] = null; } if (isset($this->fields["APP_DATA"]["DYN_CONTENT_HISTORY"])) { @@ -148,6 +148,9 @@ class pmDynaform public function jsonr(&$json) { + if(empty($json)){ + return; + } foreach ($json as $key => &$value) { $sw1 = is_array($value); $sw2 = is_object($value);