The registered plugin path refers to the resolved path using a symbolic link.
So the plugin path that Redmine gathers by PluginLoaders mismatches with the registered plugin path like the following.
Then the result of the above code is nil.
PluginLoader.directories
=>
[#<Redmine::PluginPath:0x00007f2b501b8578
@assets_dir="/home/runner/work/redmine_full_text_search/redmine/plugins/full_text_search/assets",
@dir="/home/runner/work/redmine_full_text_search/redmine/plugins/full_text_search", # <= This is unresolved path.
@initializer="/home/runner/work/redmine_full_text_search/redmine/plugins/full_text_search/init.rb">]
> p.directory
=> "/home/runner/work/redmine_full_text_search/redmine_full_text_search" # <= This is resolved path.
Solution
Use the path in Redmine's plugins directory for this plugin's directory just in case you use a symbolic link to set this plugin under Redmine's plugins/.
related: https://github.com/clear-code/redmine_full_text_search/issues/126
Issue
CI failed because of the following error.
ref: https://github.com/clear-code/redmine_full_text_search/actions/runs/8148567153/job/22271632024
Cause
ref: https://github.com/redmine/redmine/blob/fb449c77bc76b3bae9b3f0bfe18560b11f00902c/lib/redmine/plugin.rb#L107
The registered plugin path refers to the resolved path using a symbolic link. So the plugin path that Redmine gathers by
PluginLoaders
mismatches with the registered plugin path like the following. Then the result of the above code is nil.Solution
Use the path in Redmine's plugins directory for this plugin's directory just in case you use a symbolic link to set this plugin under Redmine's
plugins/
.