diff --git a/CHANGELOG.md b/CHANGELOG.md index dfa647ef..50c22e14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,3 +10,4 @@ ## 2026-01-19 - Hid staging directory, install strategy, and post-install script controls from non-admins to keep panel defaults enforced for customers. - Added the Steam Workshop mod picker, including search-backed UI, JSON state handling, and refreshed styling so customers can select mods without touching raw ID lists. +- Pointed the Workshop search endpoint at whichever panel script rendered the page so AJAX searches work in both the main panel and the customer Game Monitor. diff --git a/modules/steam_workshop/views/partials/form_fields.php b/modules/steam_workshop/views/partials/form_fields.php index 762fd1c1..398d11b4 100644 --- a/modules/steam_workshop/views/partials/form_fields.php +++ b/modules/steam_workshop/views/partials/form_fields.php @@ -47,12 +47,8 @@ $currentAdapterName = $adapterOptions[$formConfig['adapter_key']] ?? strtoupper( - - + + @@ -65,11 +61,8 @@ $currentAdapterName = $adapterOptions[$formConfig['adapter_key']] ?? strtoupper( - - + + @@ -86,12 +79,8 @@ $currentAdapterName = $adapterOptions[$formConfig['adapter_key']] ?? strtoupper( - - + + diff --git a/modules/steam_workshop/views/partials/mod_picker.php b/modules/steam_workshop/views/partials/mod_picker.php index d3aac37a..f5c223ba 100644 --- a/modules/steam_workshop/views/partials/mod_picker.php +++ b/modules/steam_workshop/views/partials/mod_picker.php @@ -5,7 +5,14 @@ declare(strict_types=1); /** @var array $home */ /** @var int $homeId */ $homeId = (int)($home['home_id'] ?? 0); -$endpoint = sprintf('?m=steam_workshop&p=main&action=search&home_id=%d', $homeId); +$scriptPath = (string)($_SERVER['PHP_SELF'] ?? '/index.php'); +if ($scriptPath === '') { + $scriptPath = '/index.php'; +} +if ($scriptPath[0] !== '/') { + $scriptPath = '/' . ltrim($scriptPath, '/'); +} +$endpoint = sprintf('%s?m=steam_workshop&p=main&action=search&home_id=%d', $scriptPath, $homeId); $initialItems = []; foreach ($config['workshop_items'] ?? [] as $item) { if (!is_array($item)) {