From 783caf38c62dff0e345fa418c3c6bf6ce669b2f9 Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Fri, 25 Jan 2013 09:55:43 -0800
Subject: [PATCH] Issue #1898236 by TwoD: Fixed Installing without English
 language leads to Fatal Error.

---
 core/includes/bootstrap.inc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index fb399e4d80d9..60b086aa7533 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -888,18 +888,18 @@ function drupal_get_filename($type, $name, $filename = NULL) {
     // nothing
   }
   else {
-    if ($type == 'module') {
-      if (empty($files[$type])) {
-        $files[$type] = drupal_container()->get('module_handler')->getModuleList();
-      }
-      if (isset($files[$type][$name])) {
-        return $files[$type][$name];
-      }
-    }
     // Verify that we have an keyvalue service before using it. This is required
     // because this function is called during installation.
     // @todo Inject database connection into KeyValueStore\DatabaseStorage.
     if (($container = drupal_container()) && $container->has('keyvalue') && function_exists('db_query')) {
+      if ($type == 'module') {
+        if (empty($files[$type])) {
+          $files[$type] = drupal_container()->get('module_handler')->getModuleList();
+        }
+        if (isset($files[$type][$name])) {
+          return $files[$type][$name];
+        }
+      }
       try {
         $file_list = state()->get('system.' . $type . '.files');
         if ($file_list && isset($file_list[$name]) && file_exists(DRUPAL_ROOT . '/' . $file_list[$name])) {
-- 
GitLab