Problem on checkout page (address pane): if i click on "Select one", i got (approximatelly) this JS AJAX pop-up error as follows:
HTTP Code: 200
Path: /system/ajax
Text: OK
Fatal error: Call to a member function copyAddress() on a non-object in uc_addresses/uc_addresses.ubercart.inc on line 168
I believe the solution is obvious, but i can't find it or i'm blind... anyway the problem is with the -1 that's considered as address ID. JS should validate the select box (option) value and check if the value is bigger then 0; and the request only if "validation" pass. Also the PHP (server side) part should valid the ID.
I hope this is not duplicate; but i didn't find it anywhere reported.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | address-select-empty-fix-1463136-2.patch | 1.68 KB | megachriz |
Comments
Comment #1
megachrizI've noticed some problems with ajax lately, but I hadn't seen this one yet.
Thanks for reporting this one. I hope to look into it soon.
Comment #2
megachrizAttached patch should fix the problem. In PHP is checked if the supplied address ID is valid one. I'm not sure yet how to check this with JS yet when using the Drupal Form API. Maybe this isn't really necessary.
Comment #3
morf2009 commentedThanks for the quick patch, i tested it, and it's working great - you helped me a lot.
I changed the status to fixed, please correct it if it's wrong. Thanks again.
Comment #4
megachrizI set it to "reviewed & tested", as in this case, the patch needs to be committed to the branch. I wait with doing that, as it may break the last patch of #1424038: Order administration: "copy address" feature (applying that patch could fail then as it refers to code that is changed a little with the patch posted in this issue).
Comment #5
morf2009 commentedThanks for your help.
Comment #6
megachrizThe fix has been committed.
Comment #7.0
(not verified) commentedadded missing info