kubitron / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
78 stars 15 forks source link

undefined method `projects_by_role' with redmine 1.1.2 #101

Open FlorentPoinsaut opened 11 years ago

FlorentPoinsaut commented 11 years ago

Hello,

Thanks for your great plugin. However, I have a little bug. When I want view an user account I have an Internal error. Here you have the production.log :

Processing UsersController#edit (for 192.168.1.1 at 2013-02-10 11:43:11) [GET]
  Parameters: {"action"=>"edit", "id"=>"19", "controller"=>"users"}
Rendering template within layouts/admin
Rendering users/edit

ActionView::TemplateError (undefined method `projects_by_role' for #<User:0x7fed97d7b9a0>) on line #56 of vendor/plugins/redmine_git_hosting/app/views/gitolite_public_keys/_view.html.erb:
53:     :url=>{:controller=>'gitolite_public_keys', :action=>@new_key ? 'create' : 'update', :id=>@gitolite_public_key.id, :user_id=>params[:id], :tab => params[:id]&&'keys'},
54:     :html => {:method=>(@new_key ? :post : :put)} do |f| %>
55:     <p><%= f.text_field :title, :label => :label_identifier_can_be_arbitrary, :required => true, :style => 'width:99%;' %></p>
56:     <% if @gitolite_public_key.key_type==1 || GitHostingHelper.can_create_deployment_keys_for_some_project(@user) %>
57:         <div class="tabular">
58:           <p>
59:             <%= f.select :key_type, options_for_select([[l(:label_user_key),0],[l(:label_deploy_key),1]], :selected => @gitolite_public_key.key_type, :disabled => (@new_key ? [] : [0,1])), :required => true, :label => :field_key_type %>

    /usr/lib/ruby/1.8/active_record/attribute_methods.rb:260:in `method_missing'
    vendor/plugins/redmine_git_hosting/app/helpers/git_hosting_helper.rb:67:in `can_create_deployment_keys_for_some_project'
    vendor/plugins/redmine_git_hosting/app/views/gitolite_public_keys/_view.html.erb:56
    /usr/lib/ruby/1.8/action_view/helpers/form_helper.rb:499:in `fields_for'
    /usr/lib/ruby/1.8/action_view/helpers/prototype_helper.rb:395:in `remote_form_for'
    vendor/plugins/redmine_git_hosting/app/helpers/application_helper.rb:29:in `labelled_remote_form_for'
    vendor/plugins/redmine_git_hosting/app/views/gitolite_public_keys/_view.html.erb:52
    /usr/lib/ruby/1.8/action_view/renderable.rb:34:in `send'
    /usr/lib/ruby/1.8/action_view/renderable.rb:34:in `render'
    /usr/lib/ruby/1.8/action_view/base.rb:306:in `with_template'
    /usr/lib/ruby/1.8/action_view/renderable.rb:30:in `render'
    /usr/lib/ruby/1.8/action_view/renderable_partial.rb:20:in `render'
    /usr/lib/ruby/1.8/action_controller/benchmarking.rb:30:in `benchmark'
    /usr/lib/ruby/1.8/action_view/renderable_partial.rb:19:in `render'
    /usr/lib/ruby/1.8/action_view/template.rb:205:in `render_template'
    /usr/lib/ruby/1.8/action_view/renderable_partial.rb:44:in `render_partial'
    /usr/lib/ruby/1.8/action_view/partials.rb:184:in `render_partial'
    /usr/lib/ruby/1.8/action_view/base.rb:267:in `render'
    app/views/common/_tabs.rhtml:24:in `_run_rhtml_app47views47common47_tabs46rhtml_locals_object_tabs'
    app/views/common/_tabs.rhtml:23:in `each'
    app/views/common/_tabs.rhtml:23:in `_run_rhtml_app47views47common47_tabs46rhtml_locals_object_tabs'
    /usr/lib/ruby/1.8/action_view/renderable.rb:34:in `send'
    /usr/lib/ruby/1.8/action_view/renderable.rb:34:in `render'
    /usr/lib/ruby/1.8/action_view/base.rb:306:in `with_template'
    /usr/lib/ruby/1.8/action_view/renderable.rb:30:in `render'
    /usr/lib/ruby/1.8/action_view/renderable_partial.rb:20:in `render'
    /usr/lib/ruby/1.8/action_controller/benchmarking.rb:30:in `benchmark'
    /usr/lib/ruby/1.8/action_view/renderable_partial.rb:19:in `render'
    /usr/lib/ruby/1.8/action_view/template.rb:205:in `render_template'
    /usr/lib/ruby/1.8/action_view/renderable_partial.rb:44:in `render_partial'
    /usr/lib/ruby/1.8/action_view/partials.rb:184:in `render_partial'
    /usr/lib/ruby/1.8/action_view/base.rb:267:in `render'
    app/helpers/application_helper.rb:204:in `render_tabs'
    app/views/users/edit.rhtml:8:in `_run_rhtml_app47views47users47edit46rhtml'
    /usr/lib/ruby/1.8/action_view/renderable.rb:34:in `send'
    /usr/lib/ruby/1.8/action_view/renderable.rb:34:in `render'
    /usr/lib/ruby/1.8/action_view/base.rb:306:in `with_template'
    /usr/lib/ruby/1.8/action_view/renderable.rb:30:in `render'
    /usr/lib/ruby/1.8/action_view/template.rb:205:in `render_template'
    /usr/lib/ruby/1.8/action_view/base.rb:265:in `render'
    /usr/lib/ruby/1.8/action_view/base.rb:348:in `_render_with_layout'
    /usr/lib/ruby/1.8/action_view/base.rb:262:in `render'
    /usr/lib/ruby/1.8/action_controller/base.rb:1250:in `render_for_file'
    /usr/lib/ruby/1.8/action_controller/base.rb:945:in `render_without_benchmark'
    /usr/lib/ruby/1.8/action_controller/benchmarking.rb:51:in `render'
    /usr/lib/ruby/1.8/action_controller/benchmarking.rb:51:in `render'
    /usr/lib/ruby/1.8/action_controller/base.rb:1326:in `default_render'
    /usr/lib/ruby/1.8/action_controller/base.rb:1332:in `perform_action_without_filters'
    /usr/lib/ruby/1.8/action_controller/filters.rb:617:in `call_filters'
    /usr/lib/ruby/1.8/action_controller/filters.rb:610:in `perform_action_without_benchmark'
    /usr/lib/ruby/1.8/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/lib/ruby/1.8/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/lib/ruby/1.8/action_controller/rescue.rb:160:in `perform_action_without_flash'
    /usr/lib/ruby/1.8/action_controller/flash.rb:146:in `perform_action'
    /usr/lib/ruby/1.8/action_controller/base.rb:532:in `send'
    /usr/lib/ruby/1.8/action_controller/base.rb:532:in `process_without_filters'
    /usr/lib/ruby/1.8/action_controller/filters.rb:606:in `process'
    /usr/lib/ruby/1.8/action_controller/base.rb:391:in `process'
    /usr/lib/ruby/1.8/action_controller/base.rb:386:in `call'
    /usr/lib/ruby/1.8/action_controller/routing/route_set.rb:437:in `call'
    /usr/lib/ruby/1.8/action_controller/dispatcher.rb:87:in `dispatch'
    /usr/lib/ruby/1.8/action_controller/dispatcher.rb:121:in `_call'
    /usr/lib/ruby/1.8/action_controller/dispatcher.rb:130:in `build_middleware_stack'
    /usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call'
    /usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call'
    /usr/lib/ruby/1.8/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    /usr/lib/ruby/1.8/active_record/query_cache.rb:9:in `cache'
    /usr/lib/ruby/1.8/active_record/query_cache.rb:28:in `call'
    /usr/lib/ruby/1.8/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
    /usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call'
    /usr/lib/ruby/1.8/rack/head.rb:9:in `call'
    /usr/lib/ruby/1.8/rack/methodoverride.rb:24:in `call'
    /usr/lib/ruby/1.8/action_controller/params_parser.rb:15:in `call'
    /usr/lib/ruby/1.8/action_controller/session/cookie_store.rb:93:in `call'
    /usr/lib/ruby/1.8/action_controller/failsafe.rb:26:in `call'
    /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
    /usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize'
    /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
    /usr/lib/ruby/1.8/action_controller/dispatcher.rb:106:in `call'
    /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
    /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    /usr/lib/phusion_passenger/passenger-spawn-server:61

Rendering /usr/share/redmine/public/500.html (500 Internal Server Error)

Thank you in advance for fixing this bug.

Regards,

n-rodriguez commented 11 years ago

Hi there! I forked the project ! https://github.com/jbox-web/redmine_git_hosting can you tell me if the problem still exists? thanks in advance for you feedback!

FlorentPoinsaut commented 11 years ago

Hi!

Thank you for your fork. I can't tell you if the problem still exists because I upgraded my host to Debian Wheezy (Redmine 1.4.4). And this issue is not present on Redmine 1.4.4

Regards,