プロジェクト

全般

プロフィール

Vote #78638

未完了

Plugin load order defined by plugin checks

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Plugin API_20
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
20
version_id:
0
issue_org_id:
26439
author_id:
303324
assigned_to_id:
0
comments:
5
status_id:
1
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

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


journals

Relates to:
* Defect #6324
* Feature #23131
* Patch #24939

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

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


related_issues

relates,Reopened,23131,Plugin load order defined by inter-plugin dependencies

Admin Redmine さんが約2年前に更新

  • カテゴリPlugin API_20 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0