ericpaulbishop / redmine_git_hosting

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

ActionView::TemplateError (uninitialized constant ActionView::Base::CompiledTemplates::TabularFormBuilder) #135

Open ghost opened 12 years ago

ghost commented 12 years ago

With the newest Redmine SVN, I am getting an error when visiting the Redmine project settings page.

Processing ProjectsController#settings (for 192.168.1.1 at 2011-12-21 08:33:55) [GET]
  Parameters: {"action"=>"settings", "id"=>"project", "controller"=>"projects"}
Rendering template within layouts/base
Rendering projects/settings

ActionView::TemplateError (uninitialized constant ActionView::Base::CompiledTemplates::TabularFormBuilder) on line #39 of vendor/plugins/redmine_git_hosting/app/views/projects/settings/_repository.rhtml:
36:
37: <% end %>
38:
39: <% remote_form_for :repository, @repository, :url => { :controller => 'repositories', :action => 'edit', :id => @project }, :builder => TabularFormBuilder,:lang => current_language do |f| %>
40:
41:     <%= error_messages_for 'repository' %>
42:     <div class="splitcontentleft">

    vendor/plugins/redmine_git_hosting/app/views/projects/settings/_repository.rhtml:39:in `_run_rhtml_vendor47plugins47redmine_git_hosting47app47views47projects47settings47_repository46rhtml_locals_object_repository_tab'
    app/views/common/_tabs.html.erb:24
    app/views/common/_tabs.html.erb:23:in `each'
    app/views/common/_tabs.html.erb:23
    app/helpers/application_helper.rb:225:in `render_tabs'
    app/views/projects/settings.html.erb:3
    passenger (3.0.7) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
    passenger (3.0.7) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
    passenger (3.0.7) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
    passenger (3.0.7) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
    passenger (3.0.7) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
    passenger (3.0.7) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
    passenger (3.0.7) lib/phusion_passenger/utils.rb:479:in `safe_fork'
    passenger (3.0.7) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
    passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
    passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:180:in `start'
    passenger (3.0.7) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
    passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
    passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
    passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
    passenger (3.0.7) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
    passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
    passenger (3.0.7) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
    passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    passenger (3.0.7) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    passenger (3.0.7) helper-scripts/passenger-spawn-server:99

Rendering /home/redmine/public/500.html (500 Internal Server Error)
andreazauli commented 12 years ago

I had the same problem. I think the solution would be to install the TabularFormBuilder plugin, with the next command: ruby script/plugin install http://svn.rubaidh.com/plugins/trunk/form_builders

buti it didn't work for me. So maybe i did something wrong or this isn't the solution.

But i discovered that the problem is the lack of the library tabular_form_builder.rb (into the lib/ directory) So i downloaded the lib from here: http://svn.ohwr.org/ohr-support/trunk/lib/tabular_form_builder.rb and i put the tabular_form_builder.rb into redmine_root/lib directory. Then i restarted apache2 and everything works now.

I think, somebody removed this library... maybe for error. i had an old installation and the library is present.

kubitron commented 12 years ago

Ok. Since the redmine crew has completely removed tabular_form_builder.rb (not a mistake -- part of the cleanup), it is better to move forward instead of backwards. I added a handler that defines the labelled_form_for and labelled_remote_form_for functions for pre-1.3.1 redmine, and altered views to fix it.

Note that they have altered the route structure as well, which causes problems with the redmine plugin.

My master branch contains a (backward-compatible) fix for these issues (as well as a number of fixes that make things more resilient, in general). Please try it out:

https://github.com/kubitron/redmine_git_hosting

Let me know how things work...

kubitron commented 12 years ago

If you tried this yesterday, please reset and repull... Slight bug in one of the commits.

ghost commented 12 years ago

I was having a similar issue on redmine 1.3.2 and the latest pull from this plugin.

Processing MyController#account (for 192.168.20.3 at 2012-04-01 01:37:53) [GET]
  Parameters: {"action"=>"account", "controller"=>"my"}
Rendering template within layouts/base
Rendering my/account

ActionView::TemplateError (uninitialized constant ApplicationHelper::TabularFormBuilder) on line #9 of vendor/plugins/redmine_git_hosting/app/views/my/account.html.erb:
6: <%= error_messages_for 'user' %>
7:
8: <div class="splitcontentleft">
9:      <% labelled_form_for :user, @user, :url => { :action => "account" }, :html => { :id => 'my_account_form' } do |f| %>
10:     <fieldset class="box tabular">
11:             <legend><%=l(:label_information_plural)%></legend>
12:             <p><%= f.text_field :firstname, :required => true %></p>

    vendor/plugins/redmine_git_hosting/app/helpers/application_helper.rb:14:in `labelled_form_for'
    vendor/plugins/redmine_git_hosting/app/views/my/account.html.erb:9
    public/dispatch.fcgi:24

I had to remove the backward campatility definitions of labelled_form_for and others in application_helper.rb. Once I did that My Account loaded fine.

I moved this to the correct place: https://github.com/kubitron/redmine_git_hosting/issues/37

kubitron commented 12 years ago

Which version of the plugin are you referring to? Is this a problem with my version (https://github.com/kubitron/redmine_git_hosting)? If so, please post over there. (p.s. I am using my version with 1.3.2 without problem). If there is something about your environment that is causing problems with this, I'd like to fix it.

kubitron commented 12 years ago

You should close this issue here, since it is for my branch...

ghost commented 12 years ago

This isn't my issue I thought my issue was related. I don't have permission to close it.

kubitron commented 12 years ago

Ok. No problem. You are right, of course.