jvang2003 / substruct

Automatically exported from code.google.com/p/substruct
0 stars 0 forks source link

Entering a faulty shipping address after it has a saved pre-existing billing addresses causes a 500 #108

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create an order 
2. do checkout, enter [only] a billing address
3. use back button on your browser
now enter a faulty shipping address.

What is the expected output? What do you see instead?
Should show errors for the shipping address fields.

Shows a 500.

What version of the product are you using? On what operating system?
1.0a3

Appears that adding to update_orders_from post method the 'save!' method [thus]

...
          if @billing_address == @shipping_address || @shipping_address.nil?
            @shipping_address =
@order_user.order_addresses.create(params[:shipping_address])
            @shipping_address.save! # raise some errors
            @order.shipping_address_id = @shipping_address.id
            result = @order.save! # add this line
            logger.info "results was #{result} from #{@order.inspect}"
          else
...
overcomes it.
Sorry it's not a real patch :)

Thanks!

Original issue reported on code.google.com by rogerpack2005 on 14 Jul 2008 at 8:48

GoogleCodeExporter commented 9 years ago

Original comment by subim...@gmail.com on 16 Aug 2008 at 3:44

GoogleCodeExporter commented 9 years ago

Original comment by subim...@gmail.com on 29 Aug 2008 at 4:32

GoogleCodeExporter commented 9 years ago
so that's to app\controllers\order_helper.rb

add the line 
@shipping_address.save!
 [near the end].

(This still occurs currently.)
Thanks so much!

Original comment by rogerpack2005 on 16 Dec 2008 at 8:29