New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `run_callbacks' for nil:NilClass during checkout #2921

Closed
huoxito opened this Issue Apr 22, 2013 · 6 comments

Comments

Projects
None yet
4 participants
@huoxito
Member

huoxito commented Apr 22, 2013

Steps to reproduce at current master:

  • Add product to cart
  • Go to checkout
  • On payment step go back and add another product to cart
  • Go to checkout again

Spree gives me this error undefined methodrun_callbacks' for nil:NilClassatfrontend/app/controllers/spree/orders_controller.rb:29`

@rterbush

This comment has been minimized.

Show comment
Hide comment
@rterbush

rterbush Apr 30, 2013

Contributor

I can confirm that this exists. Just bit me...

I've attached debugger screen in case that is useful.
nomethoderror at slash cart

Contributor

rterbush commented Apr 30, 2013

I can confirm that this exists. Just bit me...

I've attached debugger screen in case that is useful.
nomethoderror at slash cart

@huoxito

This comment has been minimized.

Show comment
Hide comment
@huoxito

huoxito Apr 30, 2013

Member

Yeah I intend to take a closer look at that. Hopefully later tonight.

On Tue, Apr 30, 2013 at 4:15 PM, Randy Terbush notifications@github.comwrote:

I can confirm that this exists. Just bit me...


Reply to this email directly or view it on GitHubhttps://github.com/spree/spree/issues/2921#issuecomment-17248231
.

Washington L Braga Jr
web developer

Member

huoxito commented Apr 30, 2013

Yeah I intend to take a closer look at that. Hopefully later tonight.

On Tue, Apr 30, 2013 at 4:15 PM, Randy Terbush notifications@github.comwrote:

I can confirm that this exists. Just bit me...


Reply to this email directly or view it on GitHubhttps://github.com/spree/spree/issues/2921#issuecomment-17248231
.

Washington L Braga Jr
web developer

huoxito added a commit to huoxito/spree that referenced this issue May 2, 2013

Only run transition callbacks if order state is cart
Calling order.next_transition.run_callbacks with order in payment state
might raise

  undefined method `run_callbacks' for nil:NilClass

And we only need to call that manually when changing from cart to
address, fixes #2921
@rterbush

This comment has been minimized.

Show comment
Hide comment
@rterbush

rterbush May 3, 2013

Contributor

Just putting my +1 in here to get this applied. This is major issue for those of us crazy enough to be running 2.0 in production. :-)

Contributor

rterbush commented May 3, 2013

Just putting my +1 in here to get this applied. This is major issue for those of us crazy enough to be running 2.0 in production. :-)

@abdul-shajin

This comment has been minimized.

Show comment
Hide comment
@abdul-shajin

abdul-shajin May 4, 2013

Contributor

I am getting this error.and since I removed the 'delivery' part.It isn't working for me..

Contributor

abdul-shajin commented May 4, 2013

I am getting this error.and since I removed the 'delivery' part.It isn't working for me..

@radar radar closed this in 1810ab6 May 7, 2013

@ehoch

This comment has been minimized.

Show comment
Hide comment
@ehoch

ehoch Aug 24, 2013

Contributor

This is also an issue in 1.3. Anyway we can get a similar fix in 1-3-stable? Same bug:

undefined method `run_callbacks' for nil:NilClass

/Users/ehochber/.rvm/gems/ruby-1.9.3-p327@alarmgrid/bundler/gems/spree-a3540a200a56/promo/app/controllers/spree/orders_controller_decorator.rb:18:in `block (2 levels) in update'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p327@alarmgrid/bundler/gems/spree-a3540a200a56/core/lib/spree/core/controller_helpers/respond_with.rb:14:in `call'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p327@alarmgrid/bundler/gems/spree-a3540a200a56/core/lib/spree/core/controller_helpers/respond_with.rb:14:in `respond_with'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p327@alarmgrid/bundler/gems/spree-a3540a200a56/promo/app/controllers/spree/orders_controller_decorator.rb:15:in `update'
Contributor

ehoch commented Aug 24, 2013

This is also an issue in 1.3. Anyway we can get a similar fix in 1-3-stable? Same bug:

undefined method `run_callbacks' for nil:NilClass

/Users/ehochber/.rvm/gems/ruby-1.9.3-p327@alarmgrid/bundler/gems/spree-a3540a200a56/promo/app/controllers/spree/orders_controller_decorator.rb:18:in `block (2 levels) in update'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p327@alarmgrid/bundler/gems/spree-a3540a200a56/core/lib/spree/core/controller_helpers/respond_with.rb:14:in `call'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p327@alarmgrid/bundler/gems/spree-a3540a200a56/core/lib/spree/core/controller_helpers/respond_with.rb:14:in `respond_with'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p327@alarmgrid/bundler/gems/spree-a3540a200a56/promo/app/controllers/spree/orders_controller_decorator.rb:15:in `update'
@huoxito

This comment has been minimized.

Show comment
Hide comment
@huoxito

huoxito Aug 24, 2013

Member

@ehoch #3613 should fix it in 1-3-stable

Member

huoxito commented Aug 24, 2013

@ehoch #3613 should fix it in 1-3-stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment