unixcharles / refinerycms-blog

Blog plugin for RefineryCMS. Currently out-of-sync with RefineryCMS, see i.resolve blog plugin meanwhile, or send me a pull request.
MIT License
14 stars 5 forks source link

Plugin Broken for gem version of refinery #5

Closed jackkinsella closed 14 years ago

jackkinsella commented 14 years ago

I'm using Refinery (as a gem) and I get this error once I install the plugin, login and click the blog tab for the first time

Processing ApplicationController#error_404 (for 127.0.0.1 at 2010-06-09 14:21:37) [GET] Parameters: {"path"=>["blog"]}

ActionView::TemplateError (undefined method `title' for nil:NilClass) on line #5 of /Users/jack/.rvm/gems/ruby-1.8.7-p174/gems/refinerycms-0.9.6.34/vendor/plugins/refinery/app/views/shared/_content_page.html.erb: 2: show_empty_sections ||= false 3: remove_automatic_sections ||= false 4: 5: body_content_title = page_title if (body_content_title = yield :body_content_title).blank? and !show_empty_sections and !remove_automatic_sections 6: body_content_left = @page[:body] if (body_content_left = yield :body_content_left).blank? and !show_empty_sections and !remove_automatic_sections 7: body_content_right = @page[:side_body] if (body_content_right = yield :body_content_right).blank? and !show_empty_sections and !remove_automatic_sections 8:

refinerycms (0.9.6.34) vendor/plugins/refinery/app/views/shared/_content_page.html.erb:5
themes/demolicious/views/pages/show.html.erb:1
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:162:in `start'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:95:in `start'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:92:in `each'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:92:in `start'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:23:in `start'
/Users/jack/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendered rescues/_trace (48.5ms) Rendered rescues/_request_and_response (58.5ms) Rendering rescues/layout (internal_server_error)

unixcharles commented 14 years ago

This mean that migration are not run properly, make sure you run refinerycms migration first, and when your migration are fully run for refinerycms, run rake refinery:blog:install and rake db:migration.

If you don't do it in this order, seed are not going to work (so the system won't find the /blog page).

awagener commented 14 years ago

I was having this problem, and how I fixed it was removing , :path_prefix => 'refinery' from line 15 of config/routes.rb. I know Refinery is moving to use /refinery over /admin but possible that change hasn't moved to the gem yet?

unixcharles commented 14 years ago

hmm, its possible, but from what I've read I guess that this happen in at /blog because in /admin or /refinery, it won't call page_content partial.

need more information, since I can't reproduce the bug

awagener commented 14 years ago

Just talked to parndt, and the admin route is currently different between the gem version of Refinery and the edge version on github. This is what's causing this bug. I've pushed a change to my fork which alters the route depending on the Refinery version which fixes this issue. :)

jackkinsella commented 14 years ago

works like a charm. you're a God awagener!

unixcharles commented 14 years ago

Make sure you also upgrade the plugin next time you update Refinery-gem!