diff options
author | Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> | 2014-08-13 04:56:44 +0000 |
---|---|---|
committer | Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> | 2014-08-13 04:56:44 +0000 |
commit | 1617ee7bd8b0df0aaf13fcd8a66c07864182381d (patch) | |
tree | 20029ca82de4cafa9cb7ff87c751bcffb169a740 /lib/redmine | |
parent | efc05bc73cf53e2c9d57147f7226f9b17a6350ce (diff) | |
download | redmine-1617ee7bd8b0df0aaf13fcd8a66c07864182381d.tar.gz redmine-1617ee7bd8b0df0aaf13fcd8a66c07864182381d.zip |
Add a warning if two plugins have the same settings partial name (#14008).
git-svn-id: http://svn.redmine.org/redmine/trunk@13336 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/plugin.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index e26ea91b9..9c67399d9 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -50,6 +50,8 @@ module Redmine #:nodoc: self.public_directory = File.join(Rails.root, 'public', 'plugin_assets') @registered_plugins = {} + @used_partials = {} + class << self attr_reader :registered_plugins private :new @@ -93,6 +95,15 @@ module Redmine #:nodoc: ActiveSupport::Dependencies.autoload_paths += [dir] end + # Warn for potential settings[:partial] collisions + if p.configurable? + partial = p.settings[:partial] + if @used_partials[partial] + Rails.logger.warn "WARNING: settings partial '#{partial}' is declared in '#{p.id}' plugin but it is already used by plugin '#{@used_partials[partial]}'. Only one settings view will be used. You may want to contact those plugins authors to fix this." + end + @used_partials[partial] = p.id + end + registered_plugins[id] = p end |