| + | + | App ID | +OS | ++ | + | + | + |
|---|---|---|---|---|---|---|---|
| + | |
+ + | + | + | + | + + + + + + | ++ + + + + | +
+ ← + + +
++ +
+ +| + | + | + | + | + |
|---|---|---|---|---|
| + | + | + | + + + + + + + + + + | ++ + + + + + + + + + | +
| + | + | + | + | + |
|---|---|---|---|---|
| + + | ++ | + + | ++ + | ++ + + + + | +
| + | + | + | + |
|---|---|---|---|
| + | + | + | + + | +
| + | + | + |
|---|
' + . (function_exists('get_lang') ? get_lang('nav_workshop_profiles') : 'Workshop Profiles') + . '
'; + $controller = new AdminWorkshopController($db); $controller->handle(); } -?> \ No newline at end of file From fd860963d10a54dbc3b68ade0935e89edb0c15db Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Apr 2026 18:06:05 +0000 Subject: [PATCH 2/2] fix: address code review feedback - Fix toggle/load_order handlers to use page-reload (not JSON) responses - Remove dead jsonResponse helper method from WorkshopModController - Fix robocopy exit code detection using ROBOCOPY_EXIT: sentinel (not text parsing) - Fix rsync dry-run change detection using RSYNC_EXIT: sentinel - Remove agentIdFromRemote() stub; pass agentId directly to triggerSteamCmdDownload() logging - Fix 'enabled' checkbox default in profile_form to use ($profile['enabled'] ?? 1) - Add missing error_toggle_failed / error_order_failed lang strings Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/dbeebd0e-e7a5-469d-8a8c-e63193d1ebb0 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- .../controllers/WorkshopModController.php | 33 ++++++---- modules/steam_workshop/lang/en_US.php | 2 + .../steam_workshop/lib/WorkshopInstaller.php | 64 ++++++++++--------- .../views/admin/profile_form.php | 2 +- .../views/user_workshop_mods.php | 4 +- 5 files changed, 59 insertions(+), 46 deletions(-) diff --git a/modules/steam_workshop/controllers/WorkshopModController.php b/modules/steam_workshop/controllers/WorkshopModController.php index 8139b6fc..68f7ae59 100644 --- a/modules/steam_workshop/controllers/WorkshopModController.php +++ b/modules/steam_workshop/controllers/WorkshopModController.php @@ -233,18 +233,25 @@ class WorkshopModController $enabled = !empty($_POST['enabled']); if ($homeId <= 0 || $workshopId === '') { - $this->jsonResponse(['ok' => false, 'error' => 'Missing parameters.']); + print_failure($this->lang['error_missing_params'] ?? 'Missing parameters.'); + $this->handleIndex($userId, $isAdmin); return; } $home = $this->getHome($homeId, $userId, $isAdmin); if ($home === null) { - $this->jsonResponse(['ok' => false, 'error' => 'Access denied.']); + print_failure($this->lang['error_home_not_found'] ?? 'Server not found.'); + $this->handleIndex($userId, $isAdmin); return; } $ok = $this->repo->toggleMod($homeId, $workshopId, $enabled); - $this->jsonResponse(['ok' => $ok]); + if (!$ok) { + print_failure($this->lang['error_toggle_failed'] ?? 'Failed to update mod status.'); + } + + $_GET['home_id'] = $homeId; + $this->handleModsPage($userId, $isAdmin); } private function handleLoadOrder(int $userId, bool $isAdmin): void @@ -254,18 +261,25 @@ class WorkshopModController $order = (int)($_POST['load_order'] ?? 0); if ($homeId <= 0 || $workshopId === '') { - $this->jsonResponse(['ok' => false, 'error' => 'Missing parameters.']); + print_failure($this->lang['error_missing_params'] ?? 'Missing parameters.'); + $this->handleIndex($userId, $isAdmin); return; } $home = $this->getHome($homeId, $userId, $isAdmin); if ($home === null) { - $this->jsonResponse(['ok' => false, 'error' => 'Access denied.']); + print_failure($this->lang['error_home_not_found'] ?? 'Server not found.'); + $this->handleIndex($userId, $isAdmin); return; } $ok = $this->repo->updateLoadOrder($homeId, $workshopId, $order); - $this->jsonResponse(['ok' => $ok]); + if (!$ok) { + print_failure($this->lang['error_order_failed'] ?? 'Failed to update load order.'); + } + + $_GET['home_id'] = $homeId; + $this->handleModsPage($userId, $isAdmin); } private function handleSync(int $userId, bool $isAdmin): void @@ -360,13 +374,6 @@ class WorkshopModController require __DIR__ . '/../views/' . $view . '.php'; } - /** @param array