mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Merge pull request #402 from creative-commoners/pulls/2.2/subsites-is-off-the-table-or-maybe-its-on-it-now-idk
FIX Catching situation where database has no tables but it exists
This commit is contained in:
commit
ce9dd1a856
@ -44,8 +44,10 @@ class InitStateMiddleware implements HTTPMiddleware
|
||||
return $delegate($request);
|
||||
} catch (DatabaseException $ex) {
|
||||
$message = $ex->getMessage();
|
||||
if (strpos($message, 'No database selected') !== false) {
|
||||
// Database is not ready, ignore and continue
|
||||
if (strpos($message, 'No database selected') !== false
|
||||
|| preg_match('/\s*(table|relation) .* does(n\'t| not) exist/i', $message)
|
||||
) {
|
||||
// Database is not ready, ignore and continue. Either it doesn't exist or it has no tables
|
||||
return $delegate($request);
|
||||
}
|
||||
throw $ex;
|
||||
|
Loading…
Reference in New Issue
Block a user