Skip to content

Commit

Permalink
Fixed #106 bug with missing database connection
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Nov 26, 2018
1 parent 193547a commit 2ffd50e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/CustomElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace MadeYourDay\RockSolidCustomElements;

use Doctrine\DBAL\DBALException;
use MadeYourDay\RockSolidCustomElements\Template\CustomTemplate;

/**
Expand Down Expand Up @@ -1153,10 +1154,15 @@ function ($count) {
}
}

$themes = \Database::getInstance()
->prepare('SELECT name, templates FROM tl_theme')
->execute()
->fetchAllAssoc();
try {
$themes = \Database::getInstance()
->prepare('SELECT name, templates FROM tl_theme')
->execute()
->fetchAllAssoc();
}
catch (DBALException $e) {
$themes = array();
}
$themeNamesByTemplateDir = array();
foreach ($themes as $theme) {
if ($theme['templates']) {
Expand Down

0 comments on commit 2ffd50e

Please sign in to comment.