Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with other plugins #16

Open
Utopism opened this issue Apr 21, 2020 · 8 comments
Open

Compatibility with other plugins #16

Utopism opened this issue Apr 21, 2020 · 8 comments

Comments

@Utopism
Copy link

Utopism commented Apr 21, 2020

Hi,

The way the project_settings_tabs method is written in the ProjectsHelperMethodsWikiExtensions module makes it impossible to have multiple overrides of this method.

please find a fix in the development branch of my fork :
https://github.com/Utopism/redmine_wiki_extensions/commits/develop

@juno-nishizaki
Copy link

I was faced with the same problem when installing plugins which have project setting tab such as Default Custom Query , DMSF and so on.

According to following article, declaring a new helper is better than using "prepend".

https://jkraemer.net/2018/05/add-a-project-settings-tab-for-your-redmine-plugin

I tried to change my local environment like this and solved it.
For your reference.

diff --git a/lib/wiki_extensions_projects_helper_patch.rb b/lib/wiki_extensions_projects_helper_patch.rb
index 2fc4857..38411c4 100644
--- a/lib/wiki_extensions_projects_helper_patch.rb
+++ b/lib/wiki_extensions_projects_helper_patch.rb
@@ -32,4 +32,4 @@ module ProjectsHelperMethodsWikiExtensions
   end
 end

-ProjectsHelper.prepend(ProjectsHelperMethodsWikiExtensions)
+ProjectsController.send :helper, ProjectsHelperMethodsWikiExtensions

Regards.

@virtio-technique
Copy link

virtio-technique commented Oct 1, 2020

I was faced with the same problem when installing plugins which have project setting tab such as Default Custom Query , DMSF and so on.

According to following article, declaring a new helper is better than using "prepend".

https://jkraemer.net/2018/05/add-a-project-settings-tab-for-your-redmine-plugin

I tried to change my local environment like this and solved it.
For your reference.

diff --git a/lib/wiki_extensions_projects_helper_patch.rb b/lib/wiki_extensions_projects_helper_patch.rb
index 2fc4857..38411c4 100644
--- a/lib/wiki_extensions_projects_helper_patch.rb
+++ b/lib/wiki_extensions_projects_helper_patch.rb
@@ -32,4 +32,4 @@ module ProjectsHelperMethodsWikiExtensions
   end
 end

-ProjectsHelper.prepend(ProjectsHelperMethodsWikiExtensions)
+ProjectsController.send :helper, ProjectsHelperMethodsWikiExtensions

Regards.

Thx! Works like a charm. It resolve a conflict issue with redmine Usability plugin. But still requires switching formatting from textile to markdown.

xoox added a commit to ifitu/redmine_wiki_extensions that referenced this issue Jan 29, 2021
@ludekruz
Copy link

Thanks, this fix on redmine_wiki_extensions saved me.
Works great on Redmine 4.1.1 with combination of plugins redmine_wiki_extensions, redmine_dmsf and redmine_contact_helpdesk.

@livius545
Copy link

@haru
I hope you will release a version with this fix applied.

@jcormier
Copy link

Similar problem with redmine_wiki_extensions/lib/wiki_extensions_notifiable_patch.rb and the redmine_checklists plugin. Creates an infinite loop when accessing the settings page.

Probably should replace all prepends with send...

@jcormier
Copy link

I hope you will release a version with this fix applied.

This was patched in September, though I don't understand why it was done through an apply function, still struggling to understand ruby.
c9ccde0#diff-4d88854d80dcb67fa52b873813683bd5bf99ea34be7d63c411fb8dfc858af3ca

@jcormier
Copy link

$ ag .prependlib/wiki_extensions_helper_patch.rb
55:Redmine::WikiFormatting::Textile::Helper.prepend(HelperMethodsWikiExtensions)

lib/wiki_extensions_wiki_controller_patch.rb
96:WikiController.prepend(InstanceMethodsForWikiExtensionWikiController)

lib/wiki_extensions_formatter_patch.rb
39:Redmine::WikiFormatting::Textile::Formatter.prepend(FormatterMethodsWikiExtensions)

lib/wiki_extensions_wiki_page_patch.rb
55:WikiPage.prepend(WikiExtensionsWikiPageMethods)

@Json1357
Copy link

Json1357 commented Dec 4, 2021

@haru
In my organization we can only install stable releases.
So I am eagerly awaiting the release of the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants