From e98b14b757c500924f717af7e5414126f9683fe5 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 19 Apr 2017 14:59:48 +0200 Subject: [PATCH] Fixed bug: Empty ImportJob payload store defaults to an empty Hash which will start the LDAP import without a config. --- lib/import/ldap/user_factory.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/import/ldap/user_factory.rb b/lib/import/ldap/user_factory.rb index 3aa4031bf..edd1b8a5c 100644 --- a/lib/import/ldap/user_factory.rb +++ b/lib/import/ldap/user_factory.rb @@ -5,8 +5,13 @@ module Import def self.import(config: nil, ldap: nil, **kargs) - config ||= Setting.get('ldap_config') - ldap ||= ::Ldap.new(config) + # config might be an empty Hash due to the ImportJob payload + # store column which will be an empty hash if the content is NULL + if config.blank? + config = Setting.get('ldap_config') + end + + ldap ||= ::Ldap.new(config) @config = config @ldap = ldap