From c439a23ef9d21d6022d31d0ee803e6cd0db244c0 Mon Sep 17 00:00:00 2001 From: enricostano Date: Thu, 6 Apr 2017 14:23:01 +0200 Subject: [PATCH] Adapt CheckoutController to new Spree changes Freely inspired by https://github.com/openfoodfoundation/spree/commit/ad5551bf846e94d641f5620d15bf7b28cb835d24 --- app/controllers/checkout_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index e002a7c723..62b8608409 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -26,9 +26,7 @@ class CheckoutController < Spree::CheckoutController return if redirect_to_paypal_express_form_if_needed end - if advance_order_state(@order) - state_callback(:after) - else + unless advance_order_state(@order) if @order.errors.present? flash[:error] = @order.errors.full_messages.to_sentence else @@ -154,7 +152,7 @@ class CheckoutController < Spree::CheckoutController raise_insufficient_quantity and return if @order.insufficient_stock_lines.present? redirect_to main_app.shop_path and return if @order.completed? before_address - state_callback(:before) + setup_for_current_state end def before_address