spree-contrib / spree_print_invoice

Create a PDF invoice for Spree orders.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
91 stars 239 forks source link

Break "create order" functionality in admin panel. Spree 3.0 #71

Closed romul closed 9 years ago

romul commented 9 years ago

Just try to open /admin/orders/new:

ActiveRecord::RecordNotFound (ActiveRecord::RecordNotFound):
  friendly_id (5.1.0) lib/friendly_id/finder_methods.rb:23:in `find'
  /Users/roman/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/spree-6d8721e0e19d/backend/app/controllers/spree/admin/orders_controller.rb:134:in `load_order'
  /Users/roman/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/spree_print_invoice-2b95eec699f8/app/controllers/spree/admin/orders_controller_decorator.rb:7:in `show'
peterberkenbosch commented 9 years ago

Yes, just had the same issue. Somehow the pdf link rendering for the order page calls the load_order. I think a @order.new_record? condition is needed.

romul commented 9 years ago

That's very strange issue... Why and where new action calls show action?

romul commented 9 years ago

Gotcha! Routes overriding in the extension treats /admin/orders/new as /admin/orders/:id

futhr commented 9 years ago

:+1: