Workaround for when the db isn't there

8.0.x
Greg Dunlap 2011-12-08 10:17:35 +01:00
parent 5d3e3a1fc3
commit 82b84d3d6b
1 changed files with 7 additions and 1 deletions

View File

@ -450,7 +450,13 @@ abstract class DrupalConfigVerifiedStorage implements DrupalConfigVerifiedStorag
class DrupalVerifiedStorageSQL extends DrupalConfigVerifiedStorage {
public function read() {
return db_query('SELECT data FROM {config} WHERE name = :name', array(':name' => $this->name))->fetchField();
// There are situations, like in the installer, where we may attempt a
// read without actually having the database available. This is a
// workaround and there is probably a better solution to be had at
// some point.
if (!empty($GLOBALS['databases'])) {
return db_query('SELECT data FROM {config} WHERE name = :name', array(':name' => $this->name))->fetchField();
}
}
public function writeToActive($data) {