pgsql

From: Damien Tournoud <damien@tournoud.net>


---

 includes/bootstrap.inc |    2 +-
 includes/common.inc    |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)


diff --git includes/bootstrap.inc includes/bootstrap.inc
index 027b392..df8eed0 100644
--- includes/bootstrap.inc
+++ includes/bootstrap.inc
@@ -1384,7 +1384,7 @@ function drupal_get_schema($table = NULL, $rebuild = FALSE) {
         drupal_alter('schema', $schema);
       }
 
-      if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL) {
+      if ($schema && (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL)) {
         cache_set('schema', $schema);
       }
     }
diff --git includes/common.inc includes/common.inc
index 026c552..adc9a0c 100644
--- includes/common.inc
+++ includes/common.inc
@@ -950,7 +950,12 @@ function t($string, $args = array(), $langcode = NULL) {
   static $custom_strings;
 
   if (!isset($langcode)) {
-    $langcode = $language->language;
+    if (isset($language->language)) {
+      $langcode = $language->language;
+    }
+    else {
+      $langcode = 'en';
+    }
   }
 
   // First, check for an array of customized strings. If present, use the array
