From df096f7803cf814029bc44d461d7821a7601823e Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Tue, 29 Aug 2017 01:47:03 +0200 Subject: [PATCH 1/2] ignore bootsnap cache directories --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 60094ab222b..67dcad40e52 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ config/discourse.conf /logfile log/ bootsnap-load-path-cache +bootsnap-compile-cache/ # Ignore plugins except for the bundled ones. /plugins/* From e9fb2c5756d31c83e3017abbd96c4b4bf29baacf Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Tue, 29 Aug 2017 01:48:30 +0200 Subject: [PATCH 2/2] phpBB3 importer: Fix validation of site settings --- script/import_scripts/phpbb3/importer.rb | 27 ++++-------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/script/import_scripts/phpbb3/importer.rb b/script/import_scripts/phpbb3/importer.rb index dfaa21951b0..8ed128d310a 100644 --- a/script/import_scripts/phpbb3/importer.rb +++ b/script/import_scripts/phpbb3/importer.rb @@ -34,32 +34,9 @@ module ImportScripts::PhpBB3 end def change_site_settings - # let's make sure that we import all attachments no matter how big they are - setting_keys = [:max_image_size_kb, :max_attachment_size_kb] - original_validators = disable_setting_validators(setting_keys) - super @importers.permalink_importer.change_site_settings - - enable_setting_validators(original_validators) - end - - def disable_setting_validators(setting_keys) - original_validators = {} - - setting_keys.each do |key| - original_validators[key] = SiteSetting.validators[key] - SiteSetting.validators[key] = nil - end - - original_validators - end - - def enable_setting_validators(original_validators) - original_validators.each do |key, validator| - SiteSetting.validators[key] = validator - end end def get_site_settings_for_import @@ -69,6 +46,10 @@ module ImportScripts::PhpBB3 settings[:max_image_size_kb] = [max_file_size_kb, SiteSetting.max_image_size_kb].max settings[:max_attachment_size_kb] = [max_file_size_kb, SiteSetting.max_attachment_size_kb].max + # temporarily disable validation since we want to import all existing images and attachments + SiteSetting.type_supervisor.load_setting(:max_image_size_kb, max: settings[:max_image_size_kb]) + SiteSetting.type_supervisor.load_setting(:max_attachment_size_kb, max: settings[:max_attachment_size_kb]) + settings end