problem fixed for migration from redmine 3.x to redmine 4

This commit is contained in:
Alexander Meindl 2018-12-29 18:12:09 +01:00
parent 3731a12fdd
commit 62d7f321ce
2 changed files with 12 additions and 3 deletions

View File

@ -6,6 +6,7 @@ Changelog
- Performance improvement (#36)
- FontAwesome 5.6.3 support
- Fix problem from migrating from Redmine 3.x to Redmine 4 with lost settings
2.0.17
++++++

View File

@ -56,10 +56,18 @@ module Additionals
end
def settings
if Rails.version >= '5.2'
Setting[:plugin_additionals]
if Setting[:plugin_additionals].class == Hash
if Rails.version >= '5.2'
# convert Rails 4 data
new_settings = ActiveSupport::HashWithIndifferentAccess.new(Setting[:plugin_additionals])
Setting.plugin_additionals = new_settings
new_settings
else
ActionController::Parameters.new(Setting[:plugin_additionals])
end
else
ActionController::Parameters.new(Setting[:plugin_additionals])
# Rails 5 uses ActiveSupport::HashWithIndifferentAccess
Setting[:plugin_additionals]
end
end