From 6ec5f812e1aa8a3ab1aa47ff8eb64f4da56164bb Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sun, 15 Mar 2026 10:19:31 -0700 Subject: [PATCH] Fix: restore cd and stderr redirect for platform-images shell_exec Got reverted during earlier merge conflict resolution. Without cd, node can't find modules. Without stderr redirect, log lines corrupt the JSON output causing json_decode to fail. Co-Authored-By: Claude Opus 4.6 --- api/setup/analyzeMenuUrl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/setup/analyzeMenuUrl.php b/api/setup/analyzeMenuUrl.php index 0f7c391..c0246da 100644 --- a/api/setup/analyzeMenuUrl.php +++ b/api/setup/analyzeMenuUrl.php @@ -190,7 +190,7 @@ JSEOF; file_put_contents($scriptPath, $script); } - $output = shell_exec("PLAYWRIGHT_BROWSERS_PATH=/opt/playwright/browsers /usr/bin/node $scriptPath " . escapeshellarg($platformUrl) . " " . escapeshellarg($tempFile) . " 2>&1"); + $output = shell_exec("cd /opt/playwright && PLAYWRIGHT_BROWSERS_PATH=/opt/playwright/browsers /usr/bin/node $scriptPath " . escapeshellarg($platformUrl) . " " . escapeshellarg($tempFile) . " 2>/tmp/platform-images-stderr.log"); @unlink($tempFile); $result = json_decode(trim($output ?? ''), true);