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.

Comments

megachriz’s picture

I'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.

megachriz’s picture

Status: Active » Needs review
StatusFileSize
new1.68 KB

Attached 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.

morf2009’s picture

Status: Needs review » Fixed

Thanks 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.

megachriz’s picture

Status: Fixed » Reviewed & tested by the community

I 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).

morf2009’s picture

Thanks for your help.

megachriz’s picture

Status: Reviewed & tested by the community » Fixed

The fix has been committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

added missing info