Can't see projects "undefined method `lft'" after upgrade
Added by Ruslan Fad over 12 years ago
On projets pages i see this error:
Processing by ProjectsController#show as HTML Parameters: {"id"=>"fsnksjdfnjk"} Rendered projects/_members_box.html.erb (6.6ms) Rendered projects/show.html.erb within layouts/base (32.1ms) Completed 500 Internal Server Error in 528ms ActionView::Template::Error (undefined method `lft' for nil:NilClass): 48: <% end %> 49: 50: <h1><%= page_header_title %></h1> 51: 52: <% if display_main_menu?(@project) %> 53: <div id="main-menu"> 54: <%= render_main_menu(@project) %> app/models/project.rb:441:in `shared_versions' lib/redmine.rb:195 lib/redmine/menu_manager.rb:196:in `call' lib/redmine/menu_manager.rb:196:in `allowed_node?' lib/redmine/menu_manager.rb:166:in `menu_items_for' lib/redmine/menu_manager.rb:165:in `each' lib/redmine/menu_manager.rb:165:in `menu_items_for' lib/redmine/menu_manager.rb:90:in `render_menu' lib/redmine/menu_manager.rb:80:in `render_main_menu' app/views/layouts/base.html.erb:51:in `_app_views_layouts_base_html_erb__714744058__623761248' app/controllers/projects_controller.rb:168:in `show'
Any help? :)
Replies (3)
RE: Can't see projects "undefined method `lft'" after upgrade
-
Added by Ruslan Fad over 12 years ago
I tried to remoived <%= render_main_menu(@project) %> in base.html.erb.
Project page now work, but project menu on page (New task, etc.) - no...
Environment: Redmine version 2.0.3.stable Ruby version 1.8.7 (i686-linux) Rails version 3.2.6 Environment production Database adapter MySQL Redmine plugins: no plugin installed
RE: Can't see projects "undefined method `lft'" after upgrade
-
Added by Ruslan Fad over 12 years ago
I fount it!)
UPDATE `projects` SET `parent_id` = NULL WHERE parent_id =0#there was 0 values
Solved
RE: Can't see projects "undefined method `lft'" after upgrade
-
Added by Martín Tolava over 12 years ago
Very Good, I have the same problem migrating Redmine 0.9 to 2.0, but i use
UPDATE `projects` SET `parent_id` = NULL WHERE 'parent_id' =0;
on my MySQL.
When I list the next tables
SELECT id, parent_id, lft, rgt FROM projects;
I see "NULL" on parent_id table.
It Works.