alphanodes / additionals

Redmine plugin for easy customization of settings, text and content display by using personal or role-based dashboards (drag&drop), providing wiki macros and act as library for other plugins.
https://www.redmine.org/plugins/additionals
GNU General Public License v2.0
131 stars 43 forks source link

Fix conflict with other plugins patching the same method #92

Closed pgrenaud closed 3 years ago

pgrenaud commented 3 years ago

Hi!

When installing this plugin, I noticed a conflict with an other plugin causing 500 errors on any page with a text area. According to redmine logs, an infinite recursive call occur between two patches trying to patch the heads_for_wiki_formatter method.

The conflicting patches in question:

This PR fix the way the heads_for_wiki_formatter method is patch, using the same way the sidebar method is patch (see wiki_patch.rb).

I have tested this PR on our staging area and it does fix the issue. Let me know if you have any comments on the PR.

Thanks!

alexandermeindl commented 3 years ago

Hi @pgrenaud

thanks for your work, but I have to deny this PR.

More and more plugins uses prepend instead of alias_method. You have to choose one of them. Because of prepend is the more modern solution, we decided to use is wherever is possible. We use other plugins together with additionals, which uses prepend for this patch. That's the reason.

In a perfect world, all plugins would use prepend nowadays :relieved:

pgrenaud commented 3 years ago

I did not think about doing it the other way around 🤦 (it does work)

Thanks!