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 Redmine 5 (#25) #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

felmab
Copy link

@felmab felmab commented Jan 20, 2023

Applied most of the changes suggested by @HarrySky in #25.

Beware I am not a Ruby developer!

@HarrySky
Copy link

HarrySky commented Feb 8, 2023

Beware I am not a Ruby developer!

Same here 😄 that's why I did not create the PR, because I am not even sure that plugin works on Redmine 5.x (I don't use it at the moment), Redmine just refused to work properly until I applied those changes to plugin

@felmab
Copy link
Author

felmab commented Feb 8, 2023

Also, I realized yesterday that the "listen" gem needs to be added as a dependency, but I do not know how this is supposed to be done.

@vsc55
Copy link

vsc55 commented Jul 6, 2023

Hi @felmab,
An error occurs with your pr::

 # bundle exec rake db:migrate RAILS_ENV=production
rake aborted!
NameError: uninitialized class variable @@schemes in URI
Did you mean?  scheme_list
/opt/redmine/redmine-5.0-stable/plugins/redmine_git_mirror/lib/redmine_git_mirror/url.rb:8:in `<module:URI>'
/opt/redmine/redmine-5.0-stable/plugins/redmine_git_mirror/lib/redmine_git_mirror/url.rb:4:in `<top (required)>'
/opt/redmine/redmine-5.0-stable/plugins/redmine_git_mirror/init.rb:4:in `<top (required)>'
/opt/redmine/redmine-5.0-stable/lib/redmine/plugin_loader.rb:31:in `load'
/opt/redmine/redmine-5.0-stable/lib/redmine/plugin_loader.rb:31:in `run_initializer'
/opt/redmine/redmine-5.0-stable/lib/redmine/plugin_loader.rb:108:in `each'
/opt/redmine/redmine-5.0-stable/lib/redmine/plugin_loader.rb:108:in `block in load'
/opt/redmine/redmine-5.0-stable/config/environment.rb:16:in `<top (required)>'
/usr/bin/bundle:9:in `load'
/usr/bin/bundle:9:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)

Fix:
In file redmine_git_mirror/lib/redmine_git_mirror/url.rb you need to replace @@schemes['GIT'] = GIT with register_scheme 'GIT', GIT

In the same redmine_git_mirror/init.rb file you also need to change require 'redmine_git_mirror/patches/repositories_helper_patch' line to this:
require File.dirname(__FILE__) + '/lib/redmine_git_mirror/patches/repositories_helper_patch'

Source: #25

@felmab
Copy link
Author

felmab commented Jul 18, 2023

As I said, I am no Ruby developer. I tried to provide something the best I could. Since you seem to be more knowledgeable than I am, you might want to provide an amended version of this PR ^^

@L-H-1995
Copy link

I have forked your repository and done further changes so that it works now completly fine with redmine 5. The changes aren't on a high programming level cause I'm not a ruby programmer but they fixed the issues with the new Rails-Version.

Fixed Redmine-Git-Mirror

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

Successfully merging this pull request may close these issues.

5 participants