Feature #28412

Reject plugin same ID with registered one

Added by Sho HASHIMOTO 3 months ago. Updated 3 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Plugin API
Target version:Candidate for next major release
Resolution:

Description

Redmine can register plugin same ID with registered one.
Currently, below problems exist.

  • @registered_plugins[id] is overwritten.
  • /admin/plugins shows only one plugin
  • but load_path, view_path, ... are changed

I want to reject and log warning second or later plugins.

functional/settings_controller_test.rb was already registered foo plugin twice. I cleared on teardown to pass unit test.

This ticket related to #27705.

redmine_plugin_register.patch Magnifier (2.96 KB) Sho HASHIMOTO, 2018-03-24 03:38

History

#1 Updated by Go MAEDA 3 months ago

  • Category changed from Plugin Request to Plugin API
  • Target version set to Candidate for next major release

We see the following error when plugin IDs conflict. It is difficult to debug. I think the patch helps to find the cause of such problems.

$ bundle exec rails c
/path/to/redmine/lib/redmine/menu_manager.rb:370:in `add_at': Child already added (RuntimeError)
    from /path/to/redmine/lib/redmine/menu_manager.rb:387:in `add'
    from /path/to/redmine/lib/redmine/menu_manager.rb:305:in `push'
    ...

Also available in: Atom PDF