From eb778b2685dd40865a67b6c238670f1b90d95668 Mon Sep 17 00:00:00 2001
From: Cam Saul <cammsaul@gmail.com>
Date: Wed, 21 Nov 2018 15:37:33 -0800
Subject: [PATCH] Make sure to require ns before resolving fns from it

---
 src/metabase/public_settings.clj | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/metabase/public_settings.clj b/src/metabase/public_settings.clj
index a8ceef90221..5b1545af295 100644
--- a/src/metabase/public_settings.clj
+++ b/src/metabase/public_settings.clj
@@ -179,17 +179,21 @@
    :anon_tracking_enabled (anon-tracking-enabled)
    :custom_geojson        (setting/get :custom-geojson)
    :custom_formatting     (setting/get :custom-formatting)
-   :email_configured      ((resolve 'metabase.email/email-configured?))
+   :email_configured      (do (require 'metabase.email)
+                              ((resolve 'metabase.email/email-configured?)))
    :embedding             (enable-embedding)
    :enable_query_caching  (enable-query-caching)
    :enable_nested_queries (enable-nested-queries)
    :enable_xrays          (enable-xrays)
-   :engines               ((resolve 'metabase.driver.util/available-drivers-info))
+   :engines               (do
+                            (require 'metabase.driver.util)
+                            ((resolve 'metabase.driver.util/available-drivers-info)))
    :ga_code               "UA-60817802-1"
    :google_auth_client_id (setting/get :google-auth-client-id)
    :has_sample_dataset    (db/exists? 'Database, :is_sample true)
    :hide_embed_branding   (metastore/hide-embed-branding?)
-   :ldap_configured       ((resolve 'metabase.integrations.ldap/ldap-configured?))
+   :ldap_configured       (do (require 'metabase.integrations.ldap)
+                              ((resolve 'metabase.integrations.ldap/ldap-configured?)))
    :available_locales     (available-locales-with-names)
    :map_tile_server_url   (map-tile-server-url)
    :metastore_url         metastore/store-url
@@ -197,7 +201,9 @@
    :premium_token         (metastore/premium-embedding-token)
    :public_sharing        (enable-public-sharing)
    :report_timezone       (setting/get :report-timezone)
-   :setup_token           ((resolve 'metabase.setup/token-value))
+   :setup_token           (do
+                            (require 'metabase.setup)
+                            ((resolve 'metabase.setup/token-value)))
    :site_name             (site-name)
    :site_url              (site-url)
    :timezone_short        (short-timezone-name (setting/get :report-timezone))
-- 
GitLab