Skip to content
Snippets Groups Projects
Commit e666688a authored by Greg Dunlap's avatar Greg Dunlap
Browse files

Exceptions now successfully being caught when db is missing

parent cc3d5edc
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -3,6 +3,7 @@
namespace Drupal\Core\Config;
use Drupal\Core\Config\DrupalConfigVerifiedStorage;
use Exception;
/**
* Represents an SQL-based configuration storage object.
......@@ -18,7 +19,8 @@ public function read() {
// catch the exception and just return an empty array so the caller can
// handle it if need be.
try {
return db_query('SELECT data FROM {config} WHERE name = :name', array(':name' => $this->name))->fetchField();
$result = db_query('SELECT data FROM {config} WHERE name = :name', array(':name' => $this->name))->fetchField();
return $result;
} catch (Exception $e) {
return array();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment