Fix: graceful handling of missing modpack_installations table
- Cron and controller wrap modpack_installations queries in try/catch - Falls through to egg variable / file detection if table missing - Added migration with IF NOT EXISTS for fresh installs - Migration won't drop the table (may be Pterodactyl-owned) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a256aa2090
commit
1783055c99
@@ -92,14 +92,18 @@ class ModpackAPIController extends Controller
|
||||
};
|
||||
}
|
||||
|
||||
// 2. Check modpack_installations table
|
||||
// 2. Check modpack_installations table (Pterodactyl — may not exist)
|
||||
if (empty($platform) || empty($modpackId)) {
|
||||
$installation = DB::table('modpack_installations')
|
||||
->where('server_id', $server->id)
|
||||
->first();
|
||||
if ($installation) {
|
||||
$platform = $platform ?: ($installation->provider ?? null);
|
||||
$modpackId = $modpackId ?: (string) ($installation->modpack_id ?? '');
|
||||
try {
|
||||
$installation = DB::table('modpack_installations')
|
||||
->where('server_id', $server->id)
|
||||
->first();
|
||||
if ($installation) {
|
||||
$platform = $platform ?: ($installation->provider ?? null);
|
||||
$modpackId = $modpackId ?: (string) ($installation->modpack_id ?? '');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Table doesn't exist on this panel — skip
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user