Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Shipping
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2012 at 05:48 UTC
Updated:
13 Jan 2013 at 22:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
Dan Z commentedHere's the patch. Short and sweet and squashes the bug.
Comment #1.0
Dan Z commentedPunctuation fix.
Comment #2
longwaveThe origin address fields don't seem to work anyway. Without the patch, if I change the country, it blows up with an Ajax error. With the patch, there is no error, but after saving the shipment it still has the original address.
Comment #3
DanZ commentedOk, I fixed that.
The $form_state['values']['pickup_address'] origin address object created by the uc_address entity does not update when the user modifies a text field. The updated text field values end up in the bottom level of $form_state['values'], so I made a patch to take the values from there.
Also, I found another problem.
While the form correctly saves the destination address, it does not (later) load it from the $shipment object when the shipment is edited. It just takes it from the $order object, even if the $shipment has already been saved. I patched the form to load from the shipment object if there is address information there.
The previous fix is still in the patch.
Now I've patched three bugs and resorted to using git so I can do a multi-file patch. My patches are getting bigger. The direction I'm heading is ominous.
Comment #4
DanZ commentedComment #6
DanZ commented#3: shipping_form-1844402-3.patch queued for re-testing.
"Connection refused" from the GIT server? That can't be good.
Comment #7
DanZ commentedWe have five followers. The patch in #3 works. Perhaps someone can test it. To execute the test:
A) Create an order (probably as a customer).
B) Go to admin/store/orders/view.
C) Click on the "package order ## products" icon for the new order from step A.
D) Create at least one package for the order. The simplest way is to select all the products and click on "Create one package".
E) Click on the Shipments tab.
F) Select the packages from step D and the "Ship manually" shipping method and click "Ship packages". The shipment creation form appears.
G)Modify the country of the sender address. Just select a different country.
Confirm: Without patch -> AJAX crash. With patch -> No crash, and the state/province selection list is updated.
H) Modify the sender and recipient street addresses then click on "Save shipment". The order shipments tab will re-display.
Confirm: Examine the {uc_shipments} table with phpmyadmin or similar tool. Without patch -> sender address is not updated. With patch -> sender address is updated.
I) Click on "edit" for the new shipment. The shipment editing form re-appears.
Confirm: Examine the destination address field. Without patch -> destination address does not reflect changes from step H. With patch -> destination address does reflect changes.
Comment #8
longwaveA slightly shorter patch that should solve all these issues. DanZ, can you confirm this works for you?
Comment #9
longwaveDoesn't seem like that country check is needed in the first place.
Comment #10
DanZ commentedConfirmed! Patch #9 passes all the tests in #7 with the vanilla version of the form and also a heavily _alter'ed version.
Comment #11
longwaveCommitted #9.
Comment #12.0
(not verified) commentedMentioned main form function.