upgrades / and plugin mods

Added by kevin foote about 9 years ago

Hi all ..

I'm in the process of upgrading from 1.4 to 2.04 (trying to get to a version for backlogs).

I've found a few github forks for my current plugins that enable 2x use. This works great..

One particular plugin that I have to have contains a patch to enable 2x compatibility. I've applied this patch but when I do a rake db:migrate I'm getting the following error..

rake aborted!
uninitialized constant RedmineHttpAuth
/var/www/redmine2/plugins/redmine_http_auth/init.rb:26:in `block in <top (required)>'
/var/www/redmine2/config/environment.rb:14:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

I'm not a regular ruby guy .. so I'm a bit lost..

The patched plugin is here https://github.com/kevinfoote/redmine_http_auth

The offending block looks like this (init.rb clip) ..

RedmineApp::Application.config.after_initialize do
  unless ApplicationController.include? (RedmineHttpAuth::HTTPAuthPatch)
    ApplicationController.send(:include, RedmineHttpAuth::HTTPAuthPatch)
  end
end

Any help would be hugely appreciated...

kevin AT footefamily DOT net

Replies (8)

RE: upgrades / and plugin mods - Added by Terence Mill about 9 years ago

Try add a

require 'http_auth_patch'

in the second line after reqire 'redmine'

Just a guess.

Provide author a bug fix if it works..

RE: upgrades / and plugin mods - Added by kevin foote about 9 years ago

Well... no go on that one.

Thanks for the tip.. I think its the correct direction but still did not work. Now my "rake aborted" output is larger :-|
I think the plugin needs to be a bit reorganized to find the bits/pieces it needs.. wondering if there are any primers out the for this sort of stuff.. again ruby is not in my background :-)

rake aborted!
uninitialized constant RedmineHttpAuth::HTTPAuthPatch::ClassMethods::HttpAuthHelper
/var/www/redmine2/plugins/redmine_http_auth/lib/http_auth_patch.rb:17:in `<module:ClassMethods>'
/var/www/redmine2/plugins/redmine_http_auth/lib/http_auth_patch.rb:16:in `<module:HTTPAuthPatch>'
/var/www/redmine2/plugins/redmine_http_auth/lib/http_auth_patch.rb:2:in `<module:RedmineHttpAuth>'
/var/www/redmine2/plugins/redmine_http_auth/lib/http_auth_patch.rb:1:in `<top (required)>'
/var/www/redmine2/plugins/redmine_http_auth/init.rb:2:in `<top (required)>'
/var/www/redmine2/lib/redmine/plugin.rb:130:in `block in load'
/var/www/redmine2/lib/redmine/plugin.rb:121:in `each'
/var/www/redmine2/lib/redmine/plugin.rb:121:in `load'
/var/www/redmine2/config/initializers/30-redmine.rb:13:in `<top (required)>'
/var/www/redmine2/config/environment.rb:14:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

RE: upgrades / and plugin mods - Added by kevin foote about 9 years ago

A bit further. Had to move the http_auth_patch.rb file around a bit, commit 2189982 on my fork.
So now we are getting past the actual upgrade stage.. and are trying to access the running app.

So now I've got the app up but the routing is throwing an error.. routes.rb looks to be correct by sight.

ActionController::RoutingError (No route matches {:controller=>"httpauth-login"}):
lib/redmine/menu_manager.rb:150:in `render_single_menu_node'
lib/redmine/menu_manager.rb:102:in `render_menu_node'

Slowly finding resources to figure out what is happening.. I've found the plugin section on the wiki. Some good info there on converting and building a plugin for Redmine 2...

RE: upgrades / and plugin mods - Added by Terence Mill about 9 years ago

Well, there is no controller httpauth-login in ur github conrtoller dir.

Routes.rb looks is not correct by sight i would say.

Btw. Did you try another fork?

https://github.com/yakaz/redmine_http_auth/commit/37fadb646f61739020c558e356cd6057df6235f0

RE: upgrades / and plugin mods - Added by kevin foote about 9 years ago

Terence,
Thank you for your pointers..

Per your advice I did try the other fork .. it does seem to work as the author (of the fork) states. Dropping the routes.rb file worked..

However, I would like to stick closer to the original plugin.. Therefor I'm still wondering why the routes.rb file does not infact work..

In my fork the goal of this line is to do the same thing as the route defined in the base Redmine install, send user to the welcome or / of the app..

match 'httpauth-login', :to => 'welcome#index'

My lack of Rails knowledge is obvious :-)

RE: upgrades / and plugin mods - Added by kevin foote about 9 years ago

OK .. think I have it pretty close to the original plugin.

I've pushed to my fork.

Done for now on this proj.. I'll try and clean it up a bit more later.

Thanks again Terence for the helpful hints.

RE: upgrades / and plugin mods - Added by John Wilcox almost 9 years ago

Hi Kevin.

I've just downloaded the source from your fork but unfortunately I still get
uninitialized constant RedmineHttpAuth::HTTPAuthPatch::ClassMethods::HttpAuthHelper

First line of the trace points to http:auth:patch.rb:17

Thank You for Your effort!
AdamLantos's plugin is exactly what I need.

RE: RE: upgrades / and plugin mods - Added by John Wilcox almost 9 years ago

I'm terribly sorry - I downloaded Your fork with the web browser and did not rename redmine_http_auth-master to redmine_http_auth.

After that, everything is working just fine!

(1-8/8)