From 0754dd365f55a1d412363d0055d2afbd3aa3f2d5 Mon Sep 17 00:00:00 2001 From: sanja <52755494+sanjacornelius@users.noreply.github.com> Date: Wed, 20 May 2026 09:59:03 -0700 Subject: [PATCH 1/2] Add SMART_EXTRACT env vars to ScriptRunners for Custom Executors Append SMART_EXTRACT_API_HOST and SMART_EXTRACT_REQUEST_TIMEOUT to the variablesParameter in ProcessMaker/ScriptRunners/Base.php. The change injects smart-extract.api_host and smart-extract.request_timeout from configuration so script runners receive the Smart Extract service host and request timeout values at runtime. --- ProcessMaker/ScriptRunners/Base.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ProcessMaker/ScriptRunners/Base.php b/ProcessMaker/ScriptRunners/Base.php index c609f3a0d6..1d610ee08a 100644 --- a/ProcessMaker/ScriptRunners/Base.php +++ b/ProcessMaker/ScriptRunners/Base.php @@ -192,6 +192,9 @@ private function getEnvironmentVariables($useEscape = true) $variablesParameter[] = 'HOST_URL=' . config('app.docker_host_url'); } + $variablesParameter[] = 'SMART_EXTRACT_API_HOST=' . config('smart-extract.api_host'); + $variablesParameter[] = 'SMART_EXTRACT_REQUEST_TIMEOUT=' . config('smart-extract.request_timeout'); + return $variablesParameter; } From 58c1cbb8b0fa227fb9d32bce6eb57bd4f174c525 Mon Sep 17 00:00:00 2001 From: sanja <52755494+sanjacornelius@users.noreply.github.com> Date: Wed, 20 May 2026 13:36:39 -0700 Subject: [PATCH 2/2] Add SMART_EXTRACT env vars to variablesParameter Include SMART_EXTRACT_API_HOST and SMART_EXTRACT_REQUEST_TIMEOUT inside both the escaped and non-escaped branches when building variablesParameter so they are properly escaped when $useEscape is true. Remove the duplicated lines that were appended outside the conditional. This ensures SMART_EXTRACT settings are consistently included alongside HOST_URL. --- ProcessMaker/ScriptRunners/Base.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ProcessMaker/ScriptRunners/Base.php b/ProcessMaker/ScriptRunners/Base.php index 1d610ee08a..d261245795 100644 --- a/ProcessMaker/ScriptRunners/Base.php +++ b/ProcessMaker/ScriptRunners/Base.php @@ -188,13 +188,14 @@ private function getEnvironmentVariables($useEscape = true) // Add the url to the host if ($useEscape) { $variablesParameter[] = 'HOST_URL=' . escapeshellarg(config('app.docker_host_url')); + $variablesParameter[] = 'SMART_EXTRACT_API_HOST=' . escapeshellarg(config('smart-extract.api_host')); + $variablesParameter[] = 'SMART_EXTRACT_REQUEST_TIMEOUT=' . escapeshellarg((string) config('smart-extract.request_timeout')); } else { $variablesParameter[] = 'HOST_URL=' . config('app.docker_host_url'); + $variablesParameter[] = 'SMART_EXTRACT_API_HOST=' . config('smart-extract.api_host'); + $variablesParameter[] = 'SMART_EXTRACT_REQUEST_TIMEOUT=' . config('smart-extract.request_timeout'); } - $variablesParameter[] = 'SMART_EXTRACT_API_HOST=' . config('smart-extract.api_host'); - $variablesParameter[] = 'SMART_EXTRACT_REQUEST_TIMEOUT=' . config('smart-extract.request_timeout'); - return $variablesParameter; }