Browse Source

Fixed #3933 - Startup of Zammad does not synchronize the custom branding logo.

Martin Edenhofer 3 years ago
parent
commit
a1af43d3e7
1 changed files with 8 additions and 5 deletions
  1. 8 5
      config/initializers/logo.rb

+ 8 - 5
config/initializers/logo.rb

@@ -2,11 +2,14 @@
 
 Rails.application.reloader.to_prepare do
 
-  next if !ActiveRecord::Base.connected?
+  begin
+    # sync logo to fs / only if settings already exists
+    next if ActiveRecord::Base.connection.tables.exclude?('settings')
 
-  # sync logo to fs / only if settings already exists
-  next if ActiveRecord::Base.connection.tables.exclude?('settings')
-  next if Setting.column_names.exclude?('state_current')
+    next if Setting.column_names.exclude?('state_current')
 
-  StaticAssets.sync
+    StaticAssets.sync
+  rescue ::ActiveRecord::NoDatabaseError
+    Rails.logger.debug("Database doesn't exist. Skipping StaticAssets.sync")
+  end
 end