refinery / refinerycms-inquiries

Inquiries extension for Refinery CMS
http://refinerycms.com
MIT License
103 stars 129 forks source link

Nil value in Inquiries#new view #21

Closed stevenhaddox closed 13 years ago

stevenhaddox commented 13 years ago

NoMethodError in Inquiries#new

Showing /Users/steven/Sites/blah.com/.bundle/ruby/1.8/gems/refinerycms-inquiries-0.9.9.9/app/views/inquiries/new.html.erb where line #3 raised:

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]
Extracted source (around line #3):

1: <% content_for :body_content_left do %>
2:   
3: <%=raw @page[Page.default_parts.first.to_sym] %> 4: 5: <%= form_for @inquiry do |f| %> 6: <%= render :partial => "/shared/admin/error_messages", Rails.root: /Users/steven/Sites/blah.com.com Application Trace | Framework Trace | Full Trace .bundle/ruby/1.8/gems/refinerycms-inquiries-0.9.9.9/app/views/inquiries/new.html.erb:3:in `__bundle_ruby_____gems_refinerycms_inquiries_________app_views_inquiries_new_html_erb___230997492_2194519260_0' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/helpers/capture_helper.rb:40:in `capture' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/helpers/capture_helper.rb:172:in `with_output_buffer' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/helpers/capture_helper.rb:40:in `capture' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/helpers/capture_helper.rb:137:in `content_for' .bundle/ruby/1.8/gems/refinerycms-inquiries-0.9.9.9/app/views/inquiries/new.html.erb:1:in `__bundle_ruby_____gems_refinerycms_inquiries_________app_views_inquiries_new_html_erb___230997492_2194519260_0' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/template.rb:135:in `send' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/template.rb:135:in `render' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/notifications.rb:54:in `instrument' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/template.rb:127:in `render' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/render/rendering.rb:59:in `_render_template' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/notifications.rb:52:in `instrument' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/notifications.rb:52:in `instrument' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/render/rendering.rb:56:in `_render_template' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_view/render/rendering.rb:26:in `render' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb:114:in `_render_template' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb:108:in `render_to_body' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/renderers.rb:47:in `render_to_body' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/compatibility.rb:55:in `render_to_body' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb:101:in `render_to_string' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb:92:in `render' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/rendering.rb:17:in `render' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/instrumentation.rb:40:in `render' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/benchmark.rb:5:in `ms' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/benchmark.rb:308:in `realtime' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/benchmark.rb:5:in `ms' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/instrumentation.rb:40:in `render' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime' .bundle/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/instrumentation.rb:39:in `render' .bundle/ruby/1.8/gems/refinerycms-0.9.8.9/vendor/refinerycms/core/lib/refinery/application_controller.rb:96:in `render' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/implicit_render.rb:10:in `default_render' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/implicit_render.rb:5:in `send_action' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/base.rb:151:in `process_action' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/rendering.rb:11:in `process_action' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/callbacks.rb:18:in `process_action' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:465:in `_run__1568646947__process_action__943997142__callbacks' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:409:in `send' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:409:in `_run_process_action_callbacks' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:93:in `send' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:93:in `run_callbacks' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/callbacks.rb:17:in `process_action' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/instrumentation.rb:30:in `process_action' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/notifications.rb:52:in `instrument' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/notifications.rb:52:in `instrument' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/instrumentation.rb:29:in `process_action' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/rescue.rb:17:in `process_action' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/base.rb:120:in `process' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb:40:in `process' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal.rb:138:in `dispatch' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_controller/metal.rb:178:in `action' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/routing/route_set.rb:62:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/routing/route_set.rb:62:in `dispatch' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/routing/route_set.rb:27:in `call' .bundle/ruby/1.8/gems/rack-mount-0.6.13/lib/rack/mount/route_set.rb:148:in `call' .bundle/ruby/1.8/gems/routing-filter-0.1.7/lib/routing_filter/adapters/rails_3.rb:68:in `recognize' .bundle/ruby/1.8/gems/rack-mount-0.6.13/lib/rack/mount/route_set.rb:139:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/routing/route_set.rb:492:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/head.rb:14:in `call' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/methodoverride.rb:24:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/params_parser.rb:21:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/flash.rb:182:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/cookies.rb:295:in `call' .bundle/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/query_cache.rb:32:in `call' .bundle/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache' .bundle/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/query_cache.rb:12:in `cache' .bundle/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/query_cache.rb:31:in `call' .bundle/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/callbacks.rb:46:in `call' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:415:in `_run_call_callbacks' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/callbacks.rb:44:in `call' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/sendfile.rb:107:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/remote_ip.rb:48:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/show_exceptions.rb:46:in `call' .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/rack/logger.rb:13:in `call' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/runtime.rb:17:in `call' .bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/cache/strategy/local_cache.rb:72:in `call' .bundle/ruby/1.8/gems/dragonfly-0.8.1/lib/dragonfly/middleware.rb:16:in `call' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:129:in `forward' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:235:in `fetch' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:178:in `lookup' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:65:in `call!' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:50:in `call' .bundle/ruby/1.8/gems/dragonfly-0.8.1/lib/dragonfly/middleware.rb:16:in `call' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:129:in `forward' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:235:in `fetch' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:178:in `lookup' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:65:in `call!' .bundle/ruby/1.8/gems/rack-cache-0.5.3/lib/rack/cache/context.rb:50:in `call' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/lock.rb:11:in `call' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/lock.rb:11:in `synchronize' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/lock.rb:11:in `call' .bundle/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/static.rb:30:in `call' .bundle/ruby/1.8/gems/refinerycms-theming-0.9.8.2/lib/theme_server.rb:27:in `call' .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/application.rb:168:in `call' .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `send' .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing' .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/rack/log_tailer.rb:14:in `call' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/content_length.rb:13:in `call' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:52:in `service' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:95:in `start' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `each' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:92:in `start' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:23:in `start' /Users/steven/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/webrick/server.rb:82:in `start' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:13:in `run' .bundle/ruby/1.8/gems/rack-1.2.1/lib/rack/server.rb:213:in `start' .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/commands/server.rb:65:in `start' .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/commands.rb:30 .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap' .bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27 script/rails:6:in `require' script/rails:6 Request Parameters: {"locale"=>:en} --- Gemfile: source 'http://rubygems.org' gem 'rails', '3.0.3' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' # gem 'sqlite3-ruby', :require => 'sqlite3' gem 'mysql' # Deploy with Capistrano gem 'capistrano' # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) gem 'ruby-debug' # gem 'ruby-debug19' # Bundle gems for the local environment. Make sure to # put test-only gems in this group so their generators # and rake tasks are available in development mode: # group :development, :test do # gem 'webrat' # end # REFINERY CMS ================================================================ java = (RUBY_PLATFORM == 'java') # Specify the Refinery CMS core: gem 'refinerycms', '~> 0.9.8.8' # Specify additional Refinery CMS Engines here (all optional): gem 'refinerycms-inquiries', '~> 0.9' gem 'refinerycms-news', '~> 0.9.9' gem 'refinerycms-portfolio', '~> 0.9.8' gem 'refinerycms-theming', '~> 0.9.8' # Add i18n support (optional, you can remove this if you really want to). gem 'refinerycms-i18n', '~> 0.9' # END REFINERY CMS ============================================================ # USER DEFINED group :development, :test do gem 'autotest' gem 'capybara' gem 'cucumber-rails' gem 'cucumber' gem 'database_cleaner' gem 'factory_girl_rails' gem 'launchy' # So you can do Then show me the page gem 'rspec-rails', '>=2.0' gem 'rspec', '>=2.0' gem 'spork' end # END USER DEFINED

Verified that when I comment out the following line everything else renders: <%=raw @page[Page.default_parts.first.to_sym] %>

I did upgrade from RefineryCMS 0.9.7. I also ran the generator and migration as instructed in the README.

parndt commented 13 years ago

Do you have a page with link_url (forward this page to another url) set to '/contact' ?

stevenhaddox commented 13 years ago

No.

I did try that though to see if it fixed it, but the obvious page title of 'Contact' ended up rendering as /contact/contact which then forwarded to /contact. If I recall correctly it still rendered the same error. I'll double-check on that.

stevenhaddox commented 13 years ago

Creating a page titled "Contact Us" that forwards to /contact seems to work.

Does anyone know if it's possible to have the generator do this step so it's not overlooked or done incorrectly? Maybe with the option of some CLI stdin to provide a non-default value for the page title?

parndt commented 13 years ago

https://github.com/resolve/refinerycms-inquiries/blob/master/db/seeds/pages_for_inquiries.rb