Project

General

Profile

Actions

Patch #26439

open

Plugin load order defined by plugin checks

Patch #26439: Plugin load order defined by plugin checks

Added by Tiago Gonçalves over 9 years ago. Updated almost 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-

Description

This patch allows for a plugin to delay loading until a set of requirements is met. This could be because I need for other plugin to be loaded first.

The ideia is to to have each plugin check at the top of init.rb for it's requirements and if they are not met to raise Redmine::Plugin::PluginDeferLoadError. This will signal the plugin load logic to try loading this plugin later.

The algorithm prevents infinite looping (by direct or indirect circular dependencies) by loading plugins by iterations. In each iteration amount of plugins to load must be lower.

The most common check made by plugins can be simplified by using at the top of the init.rb this line:

Redmine::Plugin.requires_plugin('redmine_plugin_name')

Regards


Files

redmine_plugin_load.patch (2.24 KB) redmine_plugin_load.patch Tiago Gonçalves, 2017-07-14 15:36

Related issues 1 (1 open — 0 closed)

Related to Redmine - Feature #23131: Plugin load order defined by inter-plugin dependenciesReopenedActions

Updated by Tiago Gonçalves over 9 years ago Actions #1

Relates to:

Updated by Go MAEDA over 9 years ago Actions #2

  • Category set to Plugin API

Updated by Go MAEDA over 9 years ago Actions #3

  • Related to Feature #23131: Plugin load order defined by inter-plugin dependencies added

Updated by Toshi MARUYAMA over 9 years ago Actions #4

  • Description updated (diff)

Updated by Vincent Robert almost 8 years ago Actions #5

Hello Tiago
Is this patch compatible with Redmine 4?
I quickly tried it, but I got some errors.
Thank you

Actions

Also available in: PDF Atom